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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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

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

Thank you so much!! Worked!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors