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
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
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.