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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
m_e_1203
Helper II
Helper II

RANKX

Hello,

 

I am trying to creating ranking, somehow, DAX below provides this ranking below.

 

Original Table (WorkHour) contains [ITEM_LINE] daily per [BID_Assembler]. And I would like to calculate YTD ranking by total of [ITEM_LINE].

 

DateKeyBID_AssemblerITEM_LINE
4/1/2019 A394
4/1/2019 B331
4/1/2019 C383
4/1/2019 D325
4/1/2019 E116
4/1/2019 F312
4/1/2019 G243
4/1/2019 H5

 

Total Pick Line = SUM( WorkHour[ITEM_LINE])
Rank Total Pick Line = RANKX(ALLSELECTED(WorkHour), CALCULATE([Total Pick Line], ALLEXCEPT(WorkHour, WorkHour[BID_Assembler])) , , DESC)
 
BID_AssemblerITEM_LINETotal Pick LineRank Total Pick Line
A       190,560           190,560                                 1
B       188,828           188,828                             471
C       155,889           155,889                             940
D       154,284           154,284                         1,400
E       148,067           148,067                         1,847
F       146,787           146,787                         2,092
G       140,904           140,904                         2,490
H       137,873           137,873                         2,842
I       137,746           137,746                         3,296
J       134,799           134,799                         3,763
K       134,426           134,426                         4,203
 

Why this does not show correct ranking?

 

Thank you.

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@m_e_1203 , You have to create a rank like

 

Rank Total Pick Line = RANKX(ALLSELECTED(WorkHour[BID_Assembler]), [Total Pick Line] , , DESC)

 

 

if you need ytd create a ytd measure have rank on that

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@m_e_1203 , You have to create a rank like

 

Rank Total Pick Line = RANKX(ALLSELECTED(WorkHour[BID_Assembler]), [Total Pick Line] , , DESC)

 

 

if you need ytd create a ytd measure have rank on that

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you so much!! Worked!!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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