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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
danning1234
Advocate I
Advocate I

Rankx tiebreaker

Hello,

 

I have a data table, want to rank the [ExceptionTitle] by [ServiceRequestDistNb] regardless the tie by [RequestType], when respecting the [RequestTypeSort] order.

 

Example, "Orig" should be before "Admin" for always in the rank result. Base on this, rank by measure [ServiceRequestDistNb]. That means, the rank by value is the total effect of [RequestType] ASC and [ServiceRequestDistNb] DESC.

 

The number in red is the wanted result.

 

danning1234_0-1627412565618.png

 

I have already a measure [RankByValue]. How to rank the table by this value? 

danning1234_1-1627412872977.png

 

Here is the link to the sample file.

https://www.dropbox.com/s/mancesu0g7pe4jo/Rankx.pbix?dl=0

 

Thank you.

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @danning1234 

 

have a try

Vera_33_0-1627460021276.png

RankByValue = 
  SELECTEDVALUE( 'Query1'[RequestTypeSort] )  * 1000
        + RANKX (
    ALLSELECTED(  'Query1'[ExceptionTitle] ),
    [ServiceRequestDistNb],
    ,
    DESC,
    DENSE
)


Test4- rank = 
RANKX (
       ALLSELECTED(  'Query1'[ExceptionTitle],  'Query1'[RequestType] ,'Query1'[RequestTypeSort],Query1[FiscalYear]),
[RankByValue],,ASC,DENSE
)

 

View solution in original post

1 REPLY 1
Vera_33
Resident Rockstar
Resident Rockstar

Hi @danning1234 

 

have a try

Vera_33_0-1627460021276.png

RankByValue = 
  SELECTEDVALUE( 'Query1'[RequestTypeSort] )  * 1000
        + RANKX (
    ALLSELECTED(  'Query1'[ExceptionTitle] ),
    [ServiceRequestDistNb],
    ,
    DESC,
    DENSE
)


Test4- rank = 
RANKX (
       ALLSELECTED(  'Query1'[ExceptionTitle],  'Query1'[RequestType] ,'Query1'[RequestTypeSort],Query1[FiscalYear]),
[RankByValue],,ASC,DENSE
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.