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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
syelify
Frequent Visitor

Calculate the max value by category

syelify_0-1709710644441.png

I have this table (left) and showing the result should be.

It will sum all the maximum shelves w

 

Any help will appreciated, thanks in advance!

 

4 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@syelify 

you can do the data transform in PQ

1. change date to the first day of month

11.png

12.PNG

2. group by data

13.PNG14.PNG

 

then you can get the output

15.PNG

 

However, the output is different from yours. 

 

could you pls explain why you don't count 63-65 to Jan?

 





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

Proud to be a Super User!




View solution in original post

syelify
Frequent Visitor

Thank you, would it be possible to have the Dax measure

View solution in original post

create two columns

month = FORMAT('Table'[Date],"mmm")
shelves2 = if('Table'[Shelves]=CALCULATE(max('Table'[Shelves]),ALLEXCEPT('Table','Table'[month],'Table'[Door])),'Table'[Shelves],0)
12.PNG
11.PNG
 




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

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hi @syelify 

 

Thanks to @ryan_mayu  for your timely and effective response, here are my additions:

 

You can create two measures as follow.

max = 
VAR _month = MONTH(MAX([Date]))
VAR _max = CALCULATE(MAX([Shelves]), FILTER(ALLEXCEPT('Table', 'Table'[Door]), MONTH([Date]) = _month))
RETURN
_max

 

sum = CALCULATE(SUM('Table'[Shelves]), FILTER('Table', [Shelves] = [max]))

 

Change Date to a hierarchical structure

vxuxinyimsft_1-1709778964808.png

 

Output:

vxuxinyimsft_0-1709778891282.png

 

Best Regards,
Yulia Xu

 

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

View solution in original post

5 REPLIES 5
syelify
Frequent Visitor

Thank you 🙂

Anonymous
Not applicable

Hi @syelify 

 

Thanks to @ryan_mayu  for your timely and effective response, here are my additions:

 

You can create two measures as follow.

max = 
VAR _month = MONTH(MAX([Date]))
VAR _max = CALCULATE(MAX([Shelves]), FILTER(ALLEXCEPT('Table', 'Table'[Door]), MONTH([Date]) = _month))
RETURN
_max

 

sum = CALCULATE(SUM('Table'[Shelves]), FILTER('Table', [Shelves] = [max]))

 

Change Date to a hierarchical structure

vxuxinyimsft_1-1709778964808.png

 

Output:

vxuxinyimsft_0-1709778891282.png

 

Best Regards,
Yulia Xu

 

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

syelify
Frequent Visitor

Thank you, would it be possible to have the Dax measure

create two columns

month = FORMAT('Table'[Date],"mmm")
shelves2 = if('Table'[Shelves]=CALCULATE(max('Table'[Shelves]),ALLEXCEPT('Table','Table'[month],'Table'[Door])),'Table'[Shelves],0)
12.PNG
11.PNG
 




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

Proud to be a Super User!




ryan_mayu
Super User
Super User

@syelify 

you can do the data transform in PQ

1. change date to the first day of month

11.png

12.PNG

2. group by data

13.PNG14.PNG

 

then you can get the output

15.PNG

 

However, the output is different from yours. 

 

could you pls explain why you don't count 63-65 to Jan?

 





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

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.