Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Rolling 7-Day average calculation.

I am trying to get a rolling 7 day average of a value field.  I seem to be having some issues and need some suggestions.  Thanks for any input. Current Output:   Current Measures:   Load t...
  • amitchandak's avatar
    amitchandak
    4 years ago

    Anonymous , Make sure year, month, and day are coming from date table(in visual)  and date table is marked as date table

     

    Try with small change

    7 Day Avg V3 =
    CALCULATE (
    AVERAGEX ( VALUES ( Dates[Date] ), [Rolling Load to Store Avg] ),
    DATESINPERIOD ( Dates[Date], LASTDATE ( Dates[Date] ), -7, DAY ),
    Dates[Date] < TODAY ()
    )
     
    Rolling Days Formula: https://youtu.be/cJVj5nhkKBw