Forum Discussion
Year on Year difference without date table
- 1 year ago
Hi LUCASM ,
To calculate the Year on Year (YoY) Difference and YoY Difference % without a date table, you can use DAX measures:
Create a measure for the previous year’s value:Value LY = VAR Prev_Year = MAX(Forecast[Year]) - 1 RETURN CALCULATE( [Total Value], FILTER( ALL(Forecast), Forecast[Year] = Prev_Year ) )Create a measure for the YoY Difference:
YoY Difference = [Total Value] - [Value LY]Create a measure for the YoY Difference %:
YoY Difference % = DIVIDE([YoY Difference], [Value LY], 0)This setup should give you the desired output with the values and their differences year over year.
Thank you!
Hi LUCASM ,
You already have many solutions 😀, but please note that it’s recommended to use a calendar table in your data model for year-on-year calculations. This approach ensures consistent handling of dates and leverages Power BI’s time intelligence functions for greater accuracy.
Best regards,
I agree and in all my reports I have a date table.
In this instance as the data is only yearly data I considered this an overkill as no other calculations could be run over it.
Theres no quarterly, monthly, weekly or daily data available.
Should that change - Im not holding my breath, then of course a data table would be invaluable.
But it is a very wise comment, for which I thank you.