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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kniggit270
Frequent Visitor

Summarized Ranking with RLS

Hello all,

 

Really hoping someone can help as I haven't quite found the same scenario in other posts unfortunately.

 

I have the following dataset

 

Sale IDSale DateProduct CategoryManufacturerCountry

Colour

Sales QuantityAmount
00105/04/2022LightsAUK

Blue

                  354 £               630
00208/06/2022SofasAUKRed                    74 £            3,388
00312/04/2022CushionsAUKRed                  154 £               126
00402/03/2023CurtainsAUSABlue                    90 £               363
00508/01/2023WallpaperAFranceYellow                  795 £               453
00619/12/2022LightsBItalyGreen                  200 £               334
00703/12/2022SofasBUKRed                    25 £               656
00822/06/2022CushionsBUSAYellow                  194 £                 70
00914/03/2023CurtainsBUKBlue                    38 £               232
01024/02/2023WallpaperBUKGreen                  264 £               132
01114/08/2022LightsCItalyRed                  398 £               708
01201/11/2022SofasCItalyBlue                    49 £            1,399
01315/05/2022CushionsCFranceGreen                  206 £               165
01403/07/2022CurtainsCItalyRed                    79 £               588
01503/05/2022WallpaperCUKYellow                  246 £                 76
01605/09/2022LightsDUSABlue                  231 £               413
01712/08/2022SofasDUSABlue                    57 £            1,329
01801/03/2023CushionsDUSARed                  106 £                 52
01914/09/2022CurtainsDItalyGreen                    97 £               529
02027/11/2022WallpaperDUKRed                  549 £               176

 

Which I am using for a number of different visuals across a report with RLS for Manufacturer.

 

The Manufacturer can see their performance over set period of time, YoY performance, country map, lots of things.

 

What I would like is to have ranking for the Manufacturer against it's peers acrss the different categories, and also as an overall sales amount.

 

As an example, with RLS enabled for a Manufacturer, they could see the following:

 

Manufacturer Rank (I will anonomise the names for the one not selected)

RankManufacturerAmountTotal% of Total
1B £           1,424 £         11,81912%
2A £           4,961 £         11,81942%
3C £           2,936 £         11,81925%
4D £           2,499 £         11,81921%


Country Rank

CountryRankAmountTotal% of Total
USA3 £              363 £           2,22716%
UK1 £           4,145 £           5,41677%
France2 £              453 £              61873%
Italy4 £                 -   £           3,5580%

 

 

Product Rank

CountryRankAmountTotal% of Total
Lights3 £              630 £           2,08630%
Sofas1 £           3,388 £           6,77250%
Cushions2 £              126 £              41331%
Wallpaper4 £              453 £              83754%

 

Would be great as well if for example, they selected a Country in the Country Rank table, and it filtered to the Product Rank table and the Manufacturer Rank table to give even more insight.

 

Many thanks to anyone that can help 🙂

1 REPLY 1
Kniggit270
Frequent Visitor

So I've managed to partially do it thanks to this article: https://community.powerbi.com/t5/Quick-Measures-Gallery/To-Bleep-with-RANKX/m-p/1042520#M452

 

However, the issue is, in order to acheive that, I have had to create new tables using the summarize() feature, to then use the countrows() for the ranking as it doesn't seem to work directly on the raw data. I've then created a separate table for Manufacturer which links to the variouse summary tables (one for each category).

 

What this doesn't allow for is cross filtering between categories though which really is a must.

 

I've so far got to this which allows for the cross filtering but the ranking doesn't quite come out right:

 

Product Ranking =
 
COUNTROWS(
          FILTER(
               SUMMARIZE(
                     FILTER(ALL('Sales'),'Sales'[Product] = MAX('Sales'[Product])),'Manufacturer'[Manufacturer],"Value",[Total Sales]),[Value]>=[Total Sales]))
 
With [Total Sales] as a Measure for the sum of the sales amount, and a new table with the unqiue Manufacturers names in
 
Any thoughts?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.