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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DIAS_TRINDADE
New Member

Calculate measure of max of value per month

 
DATE Ducks Max Ducks (Month)
2022-01-01 10 23
2022-01-02 2 23
2022-01-03 23 23
2022-02-01 2 10
2022-02-02 10 10

 

Given above table, I would want to calculate max number of ducks in a certain month. I have initially the first two columns, and I tried to get the third with this formula

CALCULATE(MAX(PARK[DUCKS]),ALLEXCEPT(PARKS, PARKS[DATE].[MonthNo]))
 
But this is instead what I'm getting
DATE Ducks Max Ducks (Month)
2022-01-01 10 23
2022-01-02 2 23
2022-01-03 23 23
2022-02-01 2 23
2022-02-02 10 23

 

Could anyone help me here pls? What would be the right measure to use?

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @DIAS_TRINDADE 

Thanks for reaching out to us.

You can try this measure, 

Measure = MAXX(FILTER(ALL('Table'), YEAR('Table'[DATE])=YEAR(MIN('Table'[DATE])) && MONTH('Table'[DATE])= MONTH(MIN('Table'[DATE]))),[Ducks])

then it returns max ducks according to the year and month of current row.

result

vxiaotang_0-1657533984498.png

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @DIAS_TRINDADE 

Thanks for reaching out to us.

You can try this measure, 

Measure = MAXX(FILTER(ALL('Table'), YEAR('Table'[DATE])=YEAR(MIN('Table'[DATE])) && MONTH('Table'[DATE])= MONTH(MIN('Table'[DATE]))),[Ducks])

then it returns max ducks according to the year and month of current row.

result

vxiaotang_0-1657533984498.png

 

Best Regards,

Community Support Team _Tang

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

tamerj1
Super User
Super User

Hi @DIAS_TRINDADE 

create month number as a column. But if you have multiple years then create year month number column and use it in ALLEXCEPT. It should work 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.