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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
MSirfan
Frequent Visitor

How can I get the top 10 performers (only 10 rows) from a table only by using DAX for duplicate rows

Employee Nameratings
A5
B5
C5
D5
E5
F5
G5
H4
I4
J5
K5
L4
M5

The Output should be

Employee Nameratings
A5
B5
C5
D5
E5
F5
G5
J5
K5
M5
2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Has to be a calculated table, not a measure.

View solution in original post

talespin
Solution Sage
Solution Sage

hi @MSirfan 

 

Assumption : Employee will not be repeated, need to pass unique ID.

 

Rank Emp =
RANK(DENSE, ALL(Table3), ORDERBY(Table3[Nameratings], DESC, Table3[Employee], ASC))
 
talespin_0-1710000296798.png

 

View solution in original post

6 REPLIES 6
talespin
Solution Sage
Solution Sage

hi @MSirfan 

 

Assumption : Employee will not be repeated, need to pass unique ID.

 

Rank Emp =
RANK(DENSE, ALL(Table3), ORDERBY(Table3[Nameratings], DESC, Table3[Employee], ASC))
 
talespin_0-1710000296798.png

 

lbendlin
Super User
Super User

Has to be a calculated table, not a measure.

lbendlin
Super User
Super User

TOPN(10, Table, NameRatings, DESC)

 

Note this will not be deterministic even if you specify how to handle ties.

We can't pass a column without using aggregation function in Topn function because it's takes only a single scalar value

I'm not following. 

 

lbendlin_0-1709957242534.png

 

MSirfan_0-1709958171084.png

i am getting this error 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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