Short answer: DIVIDE ( numerator, denominator [, alternate] ) divides and returns BLANK (or the alternate result) when the denominator is 0 or BLANK, instead of an error or infinity. Microsoft's guidance: use DIVIDE whenever the denominator is an expression that could be zero or blank, use the / operator when the denominator is a constant ([Revenue] / 1000), and think twice before passing an alternate such as 0, because visuals hide rows where measures are BLANK.
Every ratio in a report (margin %, conversion rate, revenue per customer, growth) is a division, and every one meets a zero somewhere: a new product with no last year, a day without visits.
What does DIVIDE return?
| Numerator | Denominator | numerator / denominator | DIVIDE | DIVIDE with alternate 0 |
|---|---|---|---|---|
| 50 | 200 | 0.25 | 0.25 | 0.25 |
| 50 | 0 | Infinity | BLANK | 0 |
| 0 | 0 | NaN | BLANK | 0 |
| 50 | BLANK | Infinity | BLANK | 0 |
| BLANK | 200 | BLANK | BLANK | BLANK |
5 / BLANK is Infinity and 0 / BLANK is NaN in DAX (Microsoft's data types table); DIVIDE avoids both.
How do you write ratio measures?
Margin % = DIVIDE ( [Revenue] - [Cost], [Revenue] )
Conversion Rate = DIVIDE ( [Orders], [Sessions] )
Revenue per Customer = DIVIDE ( [Revenue], [Customers] )
Revenue vs LY % = DIVIDE ( [Revenue] - [Revenue LY], [Revenue LY] )
-- a constant denominator: use the operator
Revenue K = [Revenue] / 1000Divide aggregates, never sum or average a ratio column: the margin of a total is total margin over total revenue, not the average of line margins (see measures vs calculated columns).
When is an alternate result right?
Microsoft's recommendation is that measures usually return BLANK, because visuals remove groupings where all measures are BLANK. An alternate of 0 brings back every empty combination as a row of zeros. Use an alternate when:
- a card must show a number, not "(Blank)":
DIVIDE ( [Returns], [Orders], 0 ), - a downstream calculation needs a number,
- zero is the true answer (no orders, so no returns rate is meaningful as 0%).
What goes wrong?
/with measure denominators. Infinity or errors appear in visuals; useDIVIDE.DIVIDEwith constants. Unnecessary checks; use/.- Alternate 0 everywhere. Long tables full of zero rows and slower visuals.
- Growth from a blank base.
DIVIDEreturns BLANK for new items; label them "new" with anIF ( ISBLANK ( [Revenue LY] ), ... ). - Ratios of ratios. Averaging percentages weights small groups like big ones; divide totals.
Where can you check this?
- Microsoft Learn: DIVIDE function (DAX)
- Microsoft Learn: DIVIDE function vs divide operator
- Microsoft Learn: Data types in Power BI Desktop
Where do you start?
Search your measures for / [ and replace each measure denominator with DIVIDE. IF and SWITCH covers the other conditions around ratios.