Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
70 | |
70 | |
34 | |
23 | |
22 |
User | Count |
---|---|
96 | |
94 | |
50 | |
42 | |
40 |