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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
itsmebvk
Continued Contributor
Continued Contributor

Ranking Based Background Color not Working?

 

Hi Folks,

 

We have a requirement to highlight top three ranking cells based on based on sales value ranking, it should update based on slicers selections too. Example : If i select different state or city top three ranking cells should highlight based on selection.

 

itsmebvamsi_0-1643869804678.png

Issue 1: This is partially working with one dimension . When I add more slicers this solution is not working (even if i add them to virtual table). I am unable to reproduce the issue here with sample data.

 

Issue2 : Is there any alternate way of creating this ranking measure without using virtual table. I cannot create virtual table for each requirement as we are using live connection to dataset different users have different ranking requirement. If we start creating virtual tables in datasets endup we will be creating more and more virtual tables.

 

Please find the attached sample data and PBI file and please provide any work around or inputs you have around this requirement.

 

https://drive.google.com/drive/folders/1v_NU9BwtX2wHTQF7x_2Mj4kO1Tf0bDpo?usp=sharing

 

Thank you.

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@itsmebvk , Rank in power Bi depends on what has been used. Like if used Part and you add any other column in row/column that part would be ranked inside that

 

Rankx(allselected(Table[Part]), [measure],,desc,dense)

 

when needing more columns you need to rank like

Rankx(Summarize(allselected(Table), Table[Part], Table[Company]) , [measure],,desc,dense)

 

Or switch between Ranks, Using isinscope

https://docs.microsoft.com/en-us/dax/isinscope-function-dax

itsmebvk
Continued Contributor
Continued Contributor

@amitchandak  

 

Thanks for quick reply.

 

can we use following expressions when we multiple tables columns inthe matrix and also we have many slicer from different tables?

 

Rankx(Summarize(allselected(Table), Table[Part], Table[Company]) , [measure],,desc,dense)


if not is there any alternative way to avoid virtual table and create a ranking using Dax?

@itsmebvk , In summarize you can use

 

Fact and then dimension

Summarize(allselected(Fact), Dim[Dim1], Dim[Dim2])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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