DAX function
IFERROR — DAX function reference
Catch and replace an error.
Syntax
dax
IFERROR(<value>, <value_if_error>)
Examples
dax
IFERROR([Ratio], 0)
→ A value
dax
IFERROR(SUM(Sales[Amount]) / SUM(Sales[Quantity]), BLANK())
→ Falls back to blank instead of surfacing a divide-by-zero error
dax
IFERROR(VALUE(Product[SKU_Numeric_Part]), -1)
→ Guards a text-to-number conversion that might fail on malformed SKUs
Common mistakes & gotchas
- IFERROR is more expensive than it looks: DAX evaluates the first argument, and if it errors, effectively re-evaluates to produce the fallback — for a simple divide-by-zero, DIVIDE() is both cheaper and more explicit than IFERROR(a/b, ...).
- It catches genuine calculation errors (conversion failures, the raw / operator’s divide-by-zero) but does not catch a BLANK() result — BLANK() is not an error in DAX, so IFERROR(SomeBlankExpr, "fallback") still returns blank, not "fallback".
Related DAX functions
From Logical & error handling