Year-over-year change in dollars, blank when there’s no last year
Show how many dollars sales grew or fell compared with last year, without fake growth in the first year of data.
You will learn to
- Calculate an absolute year-over-year change
- Explain why subtracting a blank gives a misleading result
- Return blank when there is nothing to compare with
How it works
A percentage says how fast you grew; a **dollar change** says how much. “Sales are up $46,000 on last year” is often the number a manager wants first. The formula is simply this year minus last year.
There is a catch. In DAX, a blank in arithmetic counts as **zero**, so in 2024, where there is no last-year figure, sales minus a blank is just sales. The report would claim the shop grew by its entire 2024 revenue. That is a misleading number, not a real change.
The fix is to check first. `ISBLANK(value)` returns TRUE when a value is blank, and `IF(condition, a, b)` picks one of two results. When last year is blank, return `BLANK()`; otherwise return the difference.
Practice it hands-on with a real data model and a live report that updates as you type.
Units vs LY =
VAR UnitsLY = CALCULATE([Total Quantity], SAMEPERIODLASTYEAR('Date'[Date]))
RETURN IF(ISBLANK(UnitsLY), BLANK(), [Total Quantity] - UnitsLY)