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
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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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