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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PHO
Frequent Visitor

Ranked Slicer

Can I add a ranked slicer based on a Category?
I have a Table and a Bar Chart. 
1. In this Table the first Column are Categorys,
2. the Second  is Count of Numbers

3. the third is a measure from Count of Numbers to Use is in the Ranking: 

DocumentCount = COUNT('Data'[NUMBER])
4, the last one was my try to rank:
Rank =
RANKX(
FILTER(
'Data',
'Data'[Category] = EARLIER('Data'[Category])
),
'Data'[NUMBER],
,
ASC,
Dense
)
 
 
It is ascending but unfortunately not individual.

At the end I would like to be able to select the individual categories in the slicer. Something like a TopN slicer.
But I have Problems with it since there a lot of strings in the values.

 

PHO_0-1728231899455.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PHO ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create the measures as below(it seems what you are trying to create is a calculated column to get the rank)

DocumentCount = CALCULATE(COUNT('Data'[NUMBER]),ALLEXCEPT('Data','Data'[Category]))
Rank = RANKX(ALLSELECTED(Data ), [DocumentCount],,DESC,Dense)

2. Create a table visual

vyiruanmsft_0-1728367052588.png

If the above one can't help you get the solution, please provide the required info just as suggested by Ibendlin. Thank you.

How to provide sample data in the Power BI Forum

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @PHO ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Create the measures as below(it seems what you are trying to create is a calculated column to get the rank)

DocumentCount = CALCULATE(COUNT('Data'[NUMBER]),ALLEXCEPT('Data','Data'[Category]))
Rank = RANKX(ALLSELECTED(Data ), [DocumentCount],,DESC,Dense)

2. Create a table visual

vyiruanmsft_0-1728367052588.png

If the above one can't help you get the solution, please provide the required info just as suggested by Ibendlin. Thank you.

How to provide sample data in the Power BI Forum

Best Regards

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.