Forum Discussion
rane19
Helper I
6 years agoDynamically calculate difference between columns (Multi Years)Power BI
Situation I have been tried couple answers in power bi forum but not really fit my case as calculation should be dynamically calculate the differences between columns (Multi Years). After sum up...
amitchandak
Super User
6 years agorane19 , if you want min year/max year diff, then you need first unpivot data and have data as rows
https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/
Then you can have measure like these
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
Diff = [This Year] -[Last Year]