Forum Discussion

CharlotteCity12's avatar
CharlotteCity12
Icon for Microsoft Employee rankMicrosoft Employee
4 years ago
Solved

Create an average based on 4 weeks running totals

I want to create an average based on 4 weeks   I have the following weeks and totals: the total for weeks 1, 2, 3, 4 is 160 the total for weeks 2, 3, 4, 5 is 195 the total for weeks 3, 4, 5,...
  • AlexisOlson's avatar
    4 years ago

    You could do the grouping into sets of 4 weeks and then average those sums but this should be mathematically equivalent to taking the weekly average for all weeks and multiplying by 4.

     

    If your data is at a weekly granularity already, then this should be as simple as

    Avg 4 Weeks = 4 * AVERAGE ( Table1[Total] )

     

    If not, then you'll need something more like this:

    Avg 4 Weeks = 4 * AVERAGEX ( VALUES ( Table1[WeekNum] ), [SumTotalMeasure] )