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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
AnthNC
Helper II
Helper II

Measure - Rolling average

Hi everyone!

 

Can you help me out with a rolling (or moving ?) average formula please ?

Here is the pbix file :https://drive.google.com/file/d/1tD0vPXoF9NbRuan487Rv9wdFiCuneq7v/view?usp=sharing 

 

I've created the measure "Balance" that i'm showing in a line graph like so :

AnthNC_0-1721368827643.png

 

Now i'm trying to make the same type of graph but with the averaged "Balance" for a 3 month roll, like so :

AnthNC_1-1721369009764.png

So the first marker to show on the graph would be the average of "Balance" for January, February and March.

The second marker would be the average of "Balance" for February, March and April.

And so on.

 

Can you help me out with that please ? I found the new DAX formula MOVINGAVERAGE on the microsoft site, but I can't use it in my version of pbi desktop even after the update.

 

Thank you very much

 

 

 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

hI @AnthNC ,

 

As one of the best practices, create a separate calendar/dates table. Relate that to your fact table and create this measure:

Avg Balance R3M = 
CALCULATE (
    AVERAGEX ( ALL ( 'Calendar'[Year], 'Calendar'[Month] ), [Balance] ),
    DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), - 3, MONTH )
)

danextian_0-1721379256443.png

Please attached file for the details and to this link for further explanation -https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/ 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
AnthNC
Helper II
Helper II

Thank you very much danextian.

That's exactly what i needed.

danextian
Super User
Super User

hI @AnthNC ,

 

As one of the best practices, create a separate calendar/dates table. Relate that to your fact table and create this measure:

Avg Balance R3M = 
CALCULATE (
    AVERAGEX ( ALL ( 'Calendar'[Year], 'Calendar'[Month] ), [Balance] ),
    DATESINPERIOD ( 'Calendar'[Date], MAX ( 'Calendar'[Date] ), - 3, MONTH )
)

danextian_0-1721379256443.png

Please attached file for the details and to this link for further explanation -https://www.sqlbi.com/articles/rolling-12-months-average-in-dax/ 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors