Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I wanted to present the sales of 2021 and 2022 with YOY change %.
As you can see below, the YOY value is -100% since March because "total sales this year" is 0.
I wanted to only present the months that have an actual value in YOY % (in this case, Jan and Feb).
So I used a new measure:
Solved! Go to Solution.
YOY % =
var currentSales = [Total Sales This Year]
var prevSales = [Total Sales Last Year]
return IF( currentSales > 0, DIVIDE( currentSales - prevSales, prevSales ) )
will only return a value if there are sales for this year, otherwise it will return blank
YOY % =
var currentSales = [Total Sales This Year]
var prevSales = [Total Sales Last Year]
return IF( currentSales > 0, DIVIDE( currentSales - prevSales, prevSales ) )
will only return a value if there are sales for this year, otherwise it will return blank
Thanks a lot for your help!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |