DAX function
DIVIDE — DAX function reference
Safe division.
Syntax
dax
DIVIDE(<numerator>, <denominator>, [<alternateResult>])
Examples
dax
DIVIDE([Profit], [Sales], 0)
→ A number
dax
DIVIDE(SUM(Sales[Profit]), SUM(Sales[Amount]))
→ Margin %, returns BLANK() instead of an error when Sales is 0 or blank
dax
DIVIDE([Actual], [Budget], 1) - 1
→ Variance vs. budget, defaulting to 0% instead of erroring when there is no budget row
Common mistakes & gotchas
- Returns the third argument (or blank) on divide-by-zero instead of an error. Always prefer it over the / operator.
- DIVIDE(a, b) returns BLANK() (or the alternate result) not just when b = 0, but also when b is BLANK() itself — a common source of "why is my measure blank" when a dimension has no matching fact rows.
- The plain / operator throws a real error on divide-by-zero, which can break an entire visual, whereas DIVIDE degrades gracefully — there is essentially never a reason to use / over DIVIDE in a measure.
Related DAX functions
From Logical & error handling