Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have data in the following format:
I need to find the max of month in each year, the expected output is like this:
Year Month max
2019 12
2020 5
How can i achieve this in DAX? Thank you
Solved! Go to Solution.
Hi @Anonymous ,
You can create it as a measure like this:
Max Month in Year Measure =
CALCULATE( MAX('Date'[Month]),'Date'[Year] = SELECTEDVALUE('Date'[Year]))
Or you can create a column like this:
Max Month in Year =
CALCULATE( MAX('Date'[Month]), FILTER('Date', 'Date'[Year] = EARLIER('Date'[Year]) ))
Hi @Anonymous ,
You can create it as a measure like this:
Max Month in Year Measure =
CALCULATE( MAX('Date'[Month]),'Date'[Year] = SELECTEDVALUE('Date'[Year]))
Or you can create a column like this:
Max Month in Year =
CALCULATE( MAX('Date'[Month]), FILTER('Date', 'Date'[Year] = EARLIER('Date'[Year]) ))
Hi Adescrit
Thanks for your solution. Appreciate it.
Hi @Anonymous ,
You can drag your year column and month column then mark your month column summerized as Max
or create a measure like below:-
measure=max(table[month])
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Thanks for responding if I have tried creating a measure like this:
measure=max(table[month])
But the problem is, it needs to calculate that for each year. The above method just displays 12 for both the years. I need to calculate the above using DAX expression.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 101 | |
| 76 | |
| 56 | |
| 51 | |
| 46 |