The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a simple two-column table, similar in layout to this:
Group | Total |
Red | 504 |
Green | 714 |
Yellow | 923 |
Blue | 258 |
White | 432 |
Black | 805 |
Orange | 601 |
Purple | 80 |
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?
Solved! Go to Solution.
Hi @AndrewPF
Something like this? Is it possible you have more than 1 Group for the max Total?
test = CALCULATE(VALUES('Table'[Group]),'Table'[Total]=MAX('Table'[Total]))
Hi @AndrewPF
Something like this? Is it possible you have more than 1 Group for the max Total?
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
User | Count |
---|---|
86 | |
84 | |
35 | |
35 | |
35 |
User | Count |
---|---|
94 | |
79 | |
63 | |
55 | |
52 |