Forum Discussion
Previous year measures strategy
- 2 years ago
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.
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.