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
ashamsuzzoha
Helper III
Helper III

Help with rankx(); Ties I don't understand the origin of

Hello, I'm trying to run the following simple rankx measure in a table visual.

 

Undergrounding Priority Rank = 

RANKX(
    ALL('tablename'),
    CALCULATE([Undergrounding Priority Score]),
    ,
    ASC
)

 

But placing the measure in the table leads to ties I can't figure the origin from, as show below.

rankx screenshot.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Can someone help me out here? Thanks.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@ashamsuzzoha ,

Try like, if this can work

 

Undergrounding Priority Rank = 

RANKX(
    ALL('tablename'[Feeder]),
    CALCULATE([Undergrounding Priority Score]),
    ,
    ASC
)

 

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

 

 

View solution in original post

AiolosZhao
Memorable Member
Memorable Member

Hi @ashamsuzzoha ,

 

Please try to use the below measure. It works on my desktop:

 

Measure 15 = RANKX(ALL('Table (4)'[Feeder]),[Your Measure],,ASC)

 

Aiolos Zhao 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
AiolosZhao
Memorable Member
Memorable Member

Hi @ashamsuzzoha ,

 

Please try to use the below measure. It works on my desktop:

 

Measure 15 = RANKX(ALL('Table (4)'[Feeder]),[Your Measure],,ASC)

 

Aiolos Zhao 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@ashamsuzzoha ,

Try like, if this can work

 

Undergrounding Priority Rank = 

RANKX(
    ALL('tablename'[Feeder]),
    CALCULATE([Undergrounding Priority Score]),
    ,
    ASC
)

 

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

 

 

@AiolosZhao @amitchandak Thank you, but that does not seem to have helped.

 

Now all the ranks are 1.

 

Screenshot 2020-09-14 230111.png

Hi @ashamsuzzoha ,

 

1. Is Feeder a normal column?

2. Could you please show me the measure of Undergrounding Priority Score?

3. If these columns are not in one table, could you please show me the data model?

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@AiolosZhao @amitchandak 

 

The Priority Score measure is a weighting of individual rankx measures on columns on my table, as follows:

Undergrounding Priority Score = 

[rank_column A] * weight A + 
[rank_column B] * weight B + 
[rank_column C] * weight C + 
[rank_column D] * weight D + 
[rank_column E] * weight E + 
[rank_column F] * weight F + 
[rank_column G] * weight G

where the sum of weights is 1

so I had to correct the individual rank measures with the code you suggest, and it worked.Screenshot 2020-09-15 153537.png

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.