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
ompowerbi
Helper I
Helper I

Exception Handling - Table of multiple values was supplied where a single value was expected.

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. 

 

PersonApples
John5
James7
Jake7
1 ACCEPTED 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] )
)

View solution in original post

6 REPLIES 6
johnt75
Super User
Super User

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.

tamerj1
Super User
Super User

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.

ompowerbi_1-1662981402886.png

 

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] )
)

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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