Forum Discussion

fayanan's avatar
fayanan
Frequent Visitor
5 years ago
Solved

90 day rolling average

Hello!

 

I have a dataset with complaint numbers and the dates for when they were filed. I made a line chart for Complaints by Month and my managers want to see a 90 day rolling average by month for the complaints. I googled how to do it but it seems like all the examples have continuous date data whereas I only have the dates on which complaints were filed. Would appreciate help in figuring this out. 

  • fayanan Try something like this:

    Measure = 
      VAR __Date = MAX('Table'[Date])
      VAR __Date90Days = __Date - 90
    RETURN
      COUNTROWS(FILTER('Table',[Date]>=__Date90Days && [Date]<=__Date))

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    fayanan Try something like this:

    Measure = 
      VAR __Date = MAX('Table'[Date])
      VAR __Date90Days = __Date - 90
    RETURN
      COUNTROWS(FILTER('Table',[Date]>=__Date90Days && [Date]<=__Date))