Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Sum moving by week groups

Hello, I am looking for a help with creation of calculated table which contains Orders data(multiple measures) aggregated by 13 weeks back. Please see an example of one of these calculation below: ...
  • TomMartens's avatar
    8 years ago

    Hey,

     

    maybe this measure gives you an idea:

    Moving Sum = 
    CALCULATE(
    SUM('Fact'[Value])
    ,FILTER(ALL('Calendar')
    ,'Calendar'[RunningPeriod] <= MAX('Calendar'[RunningPeriod]) && 'Calendar'[RunningPeriod] >= MAX('Calendar'[RunningPeriod]) - 1))

    Just replace the table names, replace the column reference "RunningPeriod" by your columnname WeekYear and the step by number of weeks.

    This should do the trick.

     

    Regards

    Tom