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
MaryJones
Regular Visitor

Average of the same month for the last 5 years

Hi would anyone know what dax I can use to calculate the average of the same month over the previous 5 years. So for Jan-23 the average over the previous 5 years for January would equal 20.8. 

thanks

 

For example:

Date

Cases

Jan-18

16

….

18

Dec-18

14

Jan-19

21

28

Dec-19

21

Jan-20

22

30

Dec-20

25

Jan-21

23

25

Dec-21

27

Jan-22

22

30

Dec-22

25

Jan-23

18

3 REPLIES 3
Arul
Super User
Super User

@MaryJones ,

Based on my assumption I have tried this formula, Could you use and let me know?

Last 5 Years Jan Average = 
VAR _startYear= YEAR(MAX(Table[Date]))-5
VAR _janSales = CALCULATE(
                        AVERAGE(Table[ Cases]),
                        MONTH(Table[Date])=1,
                        DATESINPERIOD(Table[Date],_startYear,5,YEAR))
RETURN _janSales

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


FreemanZ
Super User
Super User

hi @MaryJones 

With what columns are you going to present the needed measure?

Hi, the columns are Date and Cases.

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.