ISBLANK and IFERROR in DAX
In Excel, you test for a blank value with ISBLANK, and you hide an error with IFERROR. In DAX, ISBLANK and IFERROR exist too, but DIVIDE alone handles the most common case, division by zero.
In Excel
For the average price of a sale, you divide the amount by the quantity, hiding the error if the quantity is 0:
To test for a blank value:
In DAX, division
A division by zero or by a blank is handled with DIVIDE, without IFERROR:
“I want the revenue divided by the quantity, or 0 if the quantity is blank or zero.”
In a card with no filter, it returns 22,667, that is 1,700,000 divided by 75. The third argument, 0, replaces the result when the denominator is blank or zero.
In DAX, blanks and errors
ISBLANK answers TRUE when a value is blank, like ISBLANK in Excel:
“I want ‘Follow up’ if the revenue is blank, otherwise ‘Active.’”
IFERROR replaces an error, like IFERROR in Excel. Keep it for the errors DIVIDE does not cover.
What really changes
In DAX, blank is not zero. A customer with no sales has a blank revenue, and Power BI often hides its row in visuals. ISBLANK( 0 ) answers FALSE.
The full lesson shows blanks in calculations, and DIVIDE facing a zero denominator. Blank values and division
Quiz
The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.
Question 1
A customer has no sales. What does the measure DIVIDE( [Revenue], SUM( Sales[Qty] ) ) return on its row?
Question 2
The “Variance” measure is 0 on a customer’s row. What does IF( ISBLANK( [Variance] ), "Follow up", "Active" ) return on this row?
Question 3
In Excel, =IFERROR(G2/E2,0) returns 0 if the quantity is 0. Which DAX measure should you prefer to get 0 when the quantity is blank or zero?
- For a division, DIVIDE( <numerator>, <denominator>, <alternate_result> ) replaces IFERROR.
- ISBLANK works as in Excel. In DAX, blank is not zero.