Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi, I have a table of data and a DAX measure that states:
"Most Apples = CALCULATE(VALUES('Pickings[Person]),'Pickings'[Apples]=MAX('Pickings'[Apples]))"
I get the error "Table of multiple values was supplied where a single value was expected". I understand why this is. Is there a way of handling this exception, I don't care if Jake or James is returned, I just want one of the names to be returned given they have the maximum apples. Thanks.
Person | Apples |
John | 5 |
James | 7 |
Jake | 7 |
Solved! Go to Solution.
@ompowerbi
Apologies for the late response. apparently I did not pay much attention to your question. Please use
Most Apples =
CALCULATE (
MAX ( 'Pickings'[Person] ),
'Pickings'[Apples ] = MAX ( 'Pickings'[Apples] )
)
If you know that there will only be 1 entry per name you can use
Most apples =
SELECTCOLUMNS (
TOPN ( 1, Pickings, Pickings[Apples], DESC, Pickings[Name] ),
"@val", Pickings[Name]
)
To guarantee only 1 result is returned you could use Power Query to add an index column and then use that index column as a sort parameter in TOPN, to act as a tie breaker if multiple people with the same name bought the same number of apples.
Hi @ompowerbi
please try
"Most Apples = CALCULATE( SELECTEDVALUE ('Pickings[Person]),'Pickings'[Apples]=MAX('Pickings'[Apples]))"
Hi, thank you, I now get a (blank), not James or Jake, as the return using the measure above.
@ompowerbi
This depends on your filter context. Would you plase share ascreenshot of your visual for better understanding of you are trying to do. Please hide any sensitive data only keeping the whole picture.
My data is the same as in the original question. This is what I get from your suggestion.
@ompowerbi
Apologies for the late response. apparently I did not pay much attention to your question. Please use
Most Apples =
CALCULATE (
MAX ( 'Pickings'[Person] ),
'Pickings'[Apples ] = MAX ( 'Pickings'[Apples] )
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |