Forum Discussion
Previous year measures strategy
Hi all,
I have a bounch of measures in report (30+).
What I need now is to create a page with previous year comparison (currently I'm using sameperiodlastyear formula that works perfectly).
I wonder if there is a strategy to get the aim without create a new previous year measure for each actual measure (it means to have about 60+ measures đ ).
Thank you very much.
Ale
Hi Anonymous
Have you tried Calculation Groups:
DAX: Better measures with Calculation Groups (youtube.com)REDUCE the # of measures with Calculation Groups In Power BI (youtube.com)
They let you split a measure into several parts.
3 Replies
- SamWiseOwl
Super User
Hi Anonymous
Have you tried Calculation Groups:
DAX: Better measures with Calculation Groups (youtube.com)REDUCE the # of measures with Calculation Groups In Power BI (youtube.com)
They let you split a measure into several parts.
- AnonymousNot applicable
That's really powerfull and seems to do the trick!
Thank you very much for your support!!!
- asadmd93
Advocate I
Create a Calculation Group: In Tabular Editor, create a new calculation group. Add a calculation item for âPrevious Yearâ using the SAMEPERIODLASTYEAR function
Define Calculation Items: You can use the following DAX code for the "Previous Year" calculation item: CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Date'[Date]))
Apply Calculation Group: Once the calculation group is created, you can apply it to your existing measures in your report. This way, you donât need to create separate measures for each previous year comparison.
You can also refer to this video for more details: REDUCE the # of measures with Calculation Groups In Power BI (youtube.com)If my post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are always appreciated.