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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
pbi_challenger
New Member

RANKX with slicer

Hi PBI community

 

I’ve created a RANKX measure that provides the ranking of a particular client based on the number of enhancements requests they have raised.

 

I’ve played around with multiple versions incl. ALLSELECTED which doesn’t seem to fit my use case because I want to only display the rank of a single client.

 

Current formula –

 

Client Global Ranking = IF(

    HASONEVALUE(Ideas[Client Name]),

       RANKX(ALL(Ideas[Client Name]),Ideas[# Ideas]),

              BLANK())

 

The formula works great when I have multiple clients displayed in a table. As an example the third row below correctly displays a rank = 3.

 

pbi_challenger_0-1679315951664.png

 

However I want to be able to filter down to this unique client and just show that single row (or ideally in a card). But I when I apply this slicer, it just defaults to an incorrect ranking of 2 (but overall count of ideas is still correct).

pbi_challenger_1-1679315951664.png

Very stuck at this point!. Could someone please assist?

5 REPLIES 5
baltemus
Frequent Visitor

Hi, was this ever resolved?  I am running into a similar issue where when a slicer for the same dimension I am ranking over is applied, the rank value for some of the dimensions when you filter down to one dimension value at a time changes/produces an incorrect result for their ranking.

amitchandak
Super User
Super User

@pbi_challenger , remove hasonevalue and try

 

RANKX(ALL(Ideas[Client Name]),Ideas[# Ideas],,desc,dense)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi - thanks for the suggestions. Unfortuantely same issue (also if i apply skip instead of dense)

@pbi_challenger ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi - thanks for looking into this. I have a flat data structure with a +10k rows. If an idea would benefit multiple clients then that would show up across multiple rows as below.

 

I've created this measure to get the unique count per client: 

# Ideas = IF(ISBLANK(DISTINCTCOUNT(Ideas[Idea reference])),0,DISTINCTCOUNT(Ideas[Idea reference]))

 

I also have some client descriptive fields that i'm applying slicers on - eg. generate a rank based on Client size = L,XL 

 

Table name = 'Ideas'

Idea referenceClient nameClient IndustryClient Size
Idea-1Client AIndustry AXL
Idea-1Client BIndustry BL
Idea-1Client DIndustry DS
Idea-2Client AIndustry AXL
Idea-2Client CIndustry CM
Idea-3Client AIndustry AXL
Idea-4Client AIndustry AXL
Idea-4Client BIndustry BL
Idea-4Client CIndustry CM
Idea-4Client DIndustry DS
Idea-5Client AIndustry AXL
Idea-6Client BIndustry BL
Idea-7Client AIndustry AXL
Idea-8Client BIndustry BL
Idea-9Client BIndustry BL
Idea-10Client DIndustry DS
Idea-11Client AIndustry AXL
Idea-12Client AIndustry AXL
Idea-13Client BIndustry BL
Idea-14Client DIndustry DS
Idea-15Client AIndustry AXL

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.