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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.