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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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