Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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 |
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
Hi, the columns are Date and Cases.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |