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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
yogiceg
Frequent Visitor

Power BI - Rolling average for every month

Hi Experts,

Kindly assist how to make rolling average in power BI for the below excel made data. Need to make visualization with rolling average. Advance thanks.

 

Year-MonthNumber of itemsSales valueAverage per monthRolling average
2024-01201809.009.00
2024-02292428.348.67
2024-03191648.638.66
2024-04292408.288.56
2024-05151147.68.37
2024-069626.898.12
2024-072434714.469.03
2024-0810878.78.99
2024-098556.888.75
2024-1014926.578.53
2024-115163.208.05
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @yogiceg ,

 

You can try formula like below:

 

MEASURE =
AVERAGEX (
    FILTER (
        ALL ( 'SalesData' ),
        'SalesData'[Year-Month] <= MAX ( 'SalesData'[Year-Month] )
    ),
    [Average per month]
)

 

vkongfanfmsft_0-1731398749270.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
divyed
Super User
Super User

Hello @yogiceg ,

 

Here is the dax for you.

 

Rolling_Average =
CALCULATE(
    AVERAGE('Test'[Avg_per_Month]),
    FILTER(
        ALL(Test[Year-Month]),
        Test[Year-Month] <= MAX(Test[Year-Month])
    )
)
 
divyed_0-1731422877853.png

 

I hope it solves your query. Please mark this as solution if this helps .

 

Cheers

 

LinkedIn : https://www.linkedin.com/in/neeraj-kumar-62246b26/
bhanu_gautam
Super User
Super User

@yogiceg , PFA PBIX file




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Anonymous
Not applicable

Hi @yogiceg ,

 

You can try formula like below:

 

MEASURE =
AVERAGEX (
    FILTER (
        ALL ( 'SalesData' ),
        'SalesData'[Year-Month] <= MAX ( 'SalesData'[Year-Month] )
    ),
    [Average per month]
)

 

vkongfanfmsft_0-1731398749270.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

yogiceg
Frequent Visitor

Thanks for the reply. but, i am not getting the actual results. 

bhanu_gautam
Super User
Super User

@yogiceg , Try using 

 

Rolling Average =
CALCULATE(
AVERAGE('Table'[Average per month]),
DATESINPERIOD(
'Table'[Year-Month],
LASTDATE('Table'[Year-Month]),
-12,
MONTH
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Poojara_D12
Super User
Super User

Hi @yogiceg 

To create a rolling average in Power BI based on your data, follow these steps:

DAX:

 

Rolling Average = 
AVERAGEX(
    DATESINPERIOD(
        'Table'[Year-Month],
        LASTDATE('Table'[Year-Month]),
        -3,
        MONTH
    ),
    'Table'[Average per month]
)

 

Replace 'Table' with the actual name of your table in Power BI.

  • DATESINPERIOD defines the date range for the rolling average (3 months).
  • LASTDATE picks the latest date in the period.
  • AVERAGEX calculates the average over the date range

You can adjust -3 to a different number of months (e.g., -6 for a 6-month rolling average).

  • Go to Report view.
  • Insert a Line Chart from the Visualizations pane.
  • Set up the fields for the chart:
    • Drag Year-Month to the Axis.
    • Drag the new Rolling Average measure to the Values.
    • Optionally, add Average per month to compare both the actual monthly average and the rolling average.
  • Format the Line Chart as needed (line color, thickness, etc.).
  • Adjust the Date axis for clarity (ensure it's in chronological order).

This setup will display a rolling average that updates as each month is added to your data.

 

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

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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