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

Join 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.

Reply
AndrewPF
Helper V
Helper V

return a single value based on maximum value of another column

I have a simple two-column table, similar in layout to this: 

GroupTotal
Red504
Green714
Yellow923
Blue258
White432
Black805
Orange601
Purple80

from which I need to find the maximum value of Total, and the Group to which it belongs. 

I use the MAX function to find the maximum Total, but how can I get the Group associated with that maximum? 

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @AndrewPF 

 

Something like this? Is it possible you have more than 1 Group for the max Total?

Vera_33_0-1644409648496.png

test = CALCULATE(VALUES('Table'[Group]),'Table'[Total]=MAX('Table'[Total]))

 

View solution in original post

3 REPLIES 3
Vera_33
Resident Rockstar
Resident Rockstar

Hi @AndrewPF 

 

Something like this? Is it possible you have more than 1 Group for the max Total?

Vera_33_0-1644409648496.png

test = CALCULATE(VALUES('Table'[Group]),'Table'[Total]=MAX('Table'[Total]))

 

I used it, and it worked, thanks. 

But then I tried it with MIN: 

test = CALCULATE(VALUES('Table'[Group]),'Table'[Total]=MIN('Table'[Total]))

and it did not return the correct result. 

There is no duplication between the numbers. 

Any ideas? 

Ignore last message.  

It works with MIN too. 

Thank you

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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