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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
wcd1213
Frequent Visitor

Monthly rolling average where each month is represented in a column

Hi All,

 

I have a power bi table where I am trying to calculate a rolling average across 12 months. Here is how my table is set up:

 

IDYear ID YearJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember
W-12022W-1-20220.600.30.200.40.50.20000.4
W-22022W-2-20220.70.50.300.20.40.100.30.70.80
W-12023W-1-20230.70.20.60.500.10.40.500.30.90.2
W-22023W-1-20230.40.30.60.200.50.10.40.50.30.20

For examble I need W-2 from november of 2023's rolling average to have an average from November 2022 to november 2023. Is this possible with how the data is set up? 

 

Any help is appreciated.

 

2 REPLIES 2
amitchandak
Super User
Super User

@wcd1213 , Unpivot the months to be on rows, Craete a date with help from week number and then you have rolling measures like

 

Rolling 12 = CALCULATE(sum(Table[Value]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

 

 

You can also consider new Visual calculations

🚀 Power BI Update: Visual calculations (preview)🚀
https://powerbi.microsoft.com/en-us/blog/visual-calculations-preview/

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for the reply.

 

The ID column is not representing weeks, how should I configure the date table then?

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors