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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors