Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
CharlotteCity12
Microsoft Employee
Microsoft Employee

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:

weeks total.pngthe 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, 6 is 182

the total for weeks 4, 5, 6, 7 is 181

the total for weeks 5, 6, 7, 8 is 174

the total for weeks 6, 7, 8, 9 is 157

the total for weeks 7, 8, 9, 10 is 176

the total for weeks 8, 9, 10, 11 is 201

-- based on if I only have 8 - 4 week periods-- I want to create a calculation that averages the totals above or

160 +195+182+181+174+157+176+201=1426 / 8 = 178.25

 

I need a calulation that will total the four week periods (like above) then create the average.  Thank you

 

 

 

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

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] )

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

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] )

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.