Forum Discussion

Caldowd98's avatar
Caldowd98
Icon for Helper I rankHelper I
4 years ago
Solved

Prior rolling 12 months

Hi community

 

I have a measure that cacluates a sum of the last 12 months of data.

 

I now want to create the prior 12 months of data, so in theory -12 - -24 months.

 

An example of my measure is below, how would i adapt this to get the prior year ?

 

Many thanks!

 

CALCULATE(
SUM( 'Table'[QTY] ),
DATESINPERIOD( Table[Date].[Date], MAX( Table[Date] ), -12, MONTH )
  •  
    Prior rolling 12 months = CALCULATE([yourmeasure], SAMEPERIODLASTYEAR( Table[Date]))

2 Replies

  • ALLUREAN's avatar
    ALLUREAN
    Icon for Solution Sage rankSolution Sage
     
    Prior rolling 12 months = CALCULATE([yourmeasure], SAMEPERIODLASTYEAR( Table[Date]))
    • Anonymous's avatar
      Anonymous
      Not applicable

      ALLUREAN , amitchandak  Hi, can you please tell how I can make my graphs overlap with one another, I have two dax codes, one for current rolling 12 months, and another one for prior rolling 12 months, as below;

      AAAM_Prior_R12M =
       CALCULATE([Sum_Two_Rows], SAMEPERIODLASTYEAR( Calendrier[Date]))
       
      AAAM_Current_R12M = CALCULATE(([Sum_Two_Rows]), DATESINPERIOD('Calendrier'[Date], ENDOFMONTH('Appointments Manager'[Period date]), -12, MONTH))