Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      That's really powerfull and seems to do the trick!

      Thank you very much for your support!!!

  • 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 ItemsYou 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.