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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KikiLondon
Regular Visitor

Calculate average of specific months

Hi 


I have a dataset for number of accidents in various regions for the last 3 years. I want to calculate the averag number of accidents from the last 3 months but excluding the current month. 

 

e.g. we are in February 2022, therefore I want an average of accidents for Jan 22', Dec 21' and Nov 21'. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@KikiLondon , try a measure like

 

Rolling 3 = calculate(AverageX(Values('Date'[MONTH Year]),CALCULATE(sum(Sales[Sales Amount]))),DATESINPERIOD('Date'[Date ], eomonth(MAX('Date'[Date ]),-1) ,-3,MONTH))

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

View solution in original post

2 REPLIES 2
KikiLondon
Regular Visitor

Thanks @amitchandak! It worked perfectly! 

amitchandak
Super User
Super User

@KikiLondon , try a measure like

 

Rolling 3 = calculate(AverageX(Values('Date'[MONTH Year]),CALCULATE(sum(Sales[Sales Amount]))),DATESINPERIOD('Date'[Date ], eomonth(MAX('Date'[Date ]),-1) ,-3,MONTH))

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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