If the member you’re checking to see if a value is present is part of the calculation inputs, then you can use the RemoveZeros or RemoveNoData functions in the formula:
If the member you’re checking is NOT part of the calculation inputs, then you can accomplish using a Data Buffer (alternately, an EVAL statement):