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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mkohli
Frequent Visitor

Dynamically change column used for Ranking

I have a slicer which allows to me choose a field that is displayed in the matrix visuasl. I am trying to create a rank column so that the rank is created based on the field chosen in the slicer. For example in the image below, the red column has a metric (lets say count of items), so the rank would be calculaed based on count by City. But if the user chooses State from the slicer, then the rank should be calculated based on count by State. Essentially I am trying to find a way to pass a slicer selection into the RankX function. How can I do that? Or is there another way to achieve this result?

 

 

mkohli_2-1727809108971.png

 

3 REPLIES 3
lbendlin
Super User
Super User

Is your slicer single select?  What if someone selects City and Traderep1  ?

Its not single select. Ideally I would want to allow the user to select single or mutliple columns. But I know multiple selections can make it very complex, so I will make the slicer single select

 

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 not related 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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors