Forum Discussion
Sameperiod last year
- 3 years ago
Hi Casey,
There was just a small error with the DAX formula and I was able to fix it.
Also if you want the difference to calculate for the whole year you will need a separate date table with the complete months for 2023. I added it and added a new "Total Diff Full Year" measure to calculate for all of 2023.
Let me know if you have any further questions.Link: Items Fixed.pbix
Did I answer your question? Mark my post as a solution!
Hi Casy,
This isn't as straightforward as you would expect and requires the use of the ISNCOPE() function to recognize when you are not looking at the total.
You need to build a function that captures the SUM you required for the Current year (MAX) and the previous year (MIN) and then tell the measure to calculate the difference except when it is in the Year column hierarchy (row in the matrix). Note, that this will work if you only have 2 years in the matrix. if you add more it will calculate the difference between the last and earliest years.
You can see it applied in the bellow screen shot.
Link to the file I built: North Wind Base - Sameperiod last year.pbix
Did I answer your question? Mark my post as a solution!