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
Anonymous
Not applicable

Ranking with RLS

Hi, I'm stuck with the Rank measure issues on the client visual -

 

Here are the components on my report -

 

Tables -

DimDate - DateKey, Date
DimLocation - LocationKey, Region
DimClient - ClientKey, ClientID, ClientType, ClientName
DimRLSClient - ClientKey, UserName
FactSales - DateKey, ClientKey, LocationKey, Amount

Each client sees their single client key on DimRLSClient tables when login with their UserName

 

Table visuals -
Client Snapshot - ClientName, ClientID, AmountRank, PercentileRank, TotalCount,TotalAmount, DimRLSClient[ClientKey]
Marketplace Summary - ClientType, ClientID, AmountRank, PercentileRank, TotalCount, TotalAmount

Slicers -

Date Range

Region

ClientType (e.g. Retail, WholeSale, Unclassified)

 

Filter on Client Snapshot visual - DimRLSClient.ClientKey > 0 (so on Client Snapshot visual, it shows only one record)

 

Measures -
AmountRank = RANKX(ALLSELECTED('DimClient'), CALCULATE(SUM('FactSales'[Amount])),, DESC, Skip)
NumberOfRankings = MAXX(ALLSELECTED('DimClient'),'FactSales'[AmountRank])
PercentileRank = (NumberOfRankings -[AmountRank]) / (NumberOfRankings - 1) * 100

 

On the Marketplace Summary visual, the AmountRank and PercentileRank look good and respond to all slicers correctly.

 

But on the Client Snapshot visual - AmountRank is always 1, and PercentileRank is NaN. I guess I probably need to apply DimRLSClient.ClientKey filter after the Ranks are calculated. I just don't know how to do it. Can anyone please offer some solutions? Any help would be much appreciated!

 

Thanks

0 REPLIES 0

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.