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
stijn007
Regular Visitor

ranking with identical values

Hello, 

 

I want a chart with the top 10 items shown. 

In my legend I have the treinnumbers that were selected. 

Value: Count of train numbers. 

 

I created a measure 

Top 10 treinen = RANKX(ALLSELECTED('Problemen Werken FBMZ'[Treinnummer]);CALCULATE(COUNT('Problemen Werken FBMZ'[Treinnummer])))
 
This measure is ranking but the trains who have an identical count (eg 1) are ale ranked the same way.
Now there is shown 13 trains instead of my top 10.
Power BI.png
 
 
1 ACCEPTED SOLUTION

Hi @stijn007 

I notice this line

Capture10.JPG

 

You write countrows(allselected(table[column]))

Please correct it by the formula below

countrows(allselected(table))

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-juanli-msft
Community Support
Community Support

Hi @stijn007 
Create a measure
Final Rank = 
RANKX (
    ALLSELECTED('Table'),
    RANKX ( ALLSELECTED('Table'),CALCULATE(COUNT('Table'[number])),,DESC,Dense)
        + DIVIDE (
            RANKX (ALLSELECTED('Table'),CALCULATE(MAX('Table'[number])),,ASC,Dense),
            COUNTROWS(ALLSELECTED('Table'))
        ),,ASC,Dense
)
Capture4.JPG
 
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Power BI rank.jpg

 

When I tried, the ranking is different when I order in the column "Final Rank"

Somewhere it has to order in column Count. 

 

Hi @stijn007 

How do you create that incorrect measure?

Could you show me some screenshots about your columns and measure?

 

Do you want the final rank to be a column?

 

Best Regards
Maggie

Hi @stijn007 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
 
Best Regards
Maggie

Hi @stijn007 

I notice this line

Capture10.JPG

 

You write countrows(allselected(table[column]))

Please correct it by the formula below

countrows(allselected(table))

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.