Forum Discussion
YoY Calculation & Dynamic Column Header
Dear All,
I need your help/ suggestions on the following:
I have to calculate YoY and CAGR numbers for a number of years. My entire dataset is using or refers to periods mentioned as four-digit years e.g., 2019, 2020, 2021, 2022. For values this is fine, however, for YoY calculations, I need the column heading to be shown as "2022 YoY... 2023 YoY". How can I do that?... Please help.
Now in a table, I have to show the data like this:
The tables, measures, and parameters I have to use are:
1 Reply
- amitchandakSuper User
rohit403 ,with help from a separate year or date table you can have measures like the example
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])But if you want a matrix with years and only select YOY, you might need a hybrid table
if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc