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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SpartanGhost
New Member

TOPN Max Sales Duplication

Hello, 


Hoping you could possibly help, I'm having an issue with the below DAX as there are duplicates in the dataset, so TOPN wont run and the visual fails as "A table of multiple values was supplied where a single value was expected". 

 

I want to receive the name of the MAX salesperson but in one scenario 2 salespersons have sold 9 then the visual fails. 

 

Yet, any other filter applied where there are unique sales values the visual works fine and is able to calculate the MAX salesperson.

 

 

highestRecordedName =
TOPN(
    1,
    VALUES(Sales[Sales Person]),
    CALCULATE(SUM(Sales[Total Sales]))
)
 
 
 
Thanks in advance!

 

1 REPLY 1
lbendlin
Super User
Super User

Add a small random number to the sum of sales for each rep to break the ties.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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