Forum Discussion
How to calculate the difference between columns in matrix
mnsen , Create a new table year and year period and then create a rank on period
New columns in period table
Period Rank = RANKX(all('Period'),'Period'[year period],,ASC,Dense)
measure
This Period= CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period= CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))
diff = [This Period] -[Last Period]
The same approach I discussed in my Week Blog
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
Hi amitchandak
Thank you for your reply. unfortunately, the solution didnot work:
This is the new table including the rank on the period: