cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sam1220 Frequent Visitor
Frequent Visitor

HELP: RANKX Function

So I have a table that shows countries. Now I want to get the top 3 countries that are most common in the column.

Capture

So I decided to play around with RANKX, seen multiple threads. Most 'helpful' one is http://community.powerbi.com/t5/Desktop/Ranking-Subjects/m-p/21663#M6731 this one. However, as you can see in the table, all it shows is rank number one.

 

What I've done in cc is COUNTA column. But in the rank column is this:

Measure:                   Measure = COUNT(Table1[Countries])

Rank Column:           Rank = RANKX(ALLSELECTED(Table1), [Measure])

 

Any help is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
BhaveshPatel Super Contributor
Super Contributor

Re: HELP: RANKX Function

You can use this two measures for the ranking of the countries:

 

 

Total Rows:=COUNTROWS(Table1)

 

Top Countries := RANKX(ALL(Table1),[Total Rows],,,Dense)

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

2 REPLIES 2
BhaveshPatel Super Contributor
Super Contributor

Re: HELP: RANKX Function

You can use this two measures for the ranking of the countries:

 

 

Total Rows:=COUNTROWS(Table1)

 

Top Countries := RANKX(ALL(Table1),[Total Rows],,,Dense)

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

sam1220 Frequent Visitor
Frequent Visitor

Re: HELP: RANKX Function

Yep, added the measure to the visual filter. Worked like charm. Sorting works great too! Thanks for the help

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)