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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Dodzik
Frequent Visitor

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:

 

example

 

 

In this example you can see that value of desired measure is calculated as sum moving on WeekYear attribute which is available in date dimension. Value for 201825 is a summary of weeks from 25 to 13(25-13), 201824 is 24 to 12 etc.. This of course has to be able to work dynamically when it comes to turn of the year.

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.