Forum Discussion

kpost's avatar
kpost
Icon for Solution Sage rankSolution Sage
3 years ago
Solved

'Rolling' Cumulative Measure value: previous 365 days

I am looking for help with DAX:   I am creating a line graph with the date along the X axis.   I'm looking to create a measure where for each data point along the x axis, it is calculated by look...
  • Greg_Deckler's avatar
    3 years ago

    kpost You should be able to do this:

    Measure = 
      VAR __Date = MAX('Date_Filter'[Date])
      VAR __MinDate= __Date - 365
      VAR __Result = CALCULATE([Adjusted_%_Value], 'Date_Filter'[Date] >= __MinDate && 'Date_Filter'[Date] <= __Date)
    RETURN
      __Result

     

    If that doesn't work you can try an alternate approach here: