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
Shelley
Continued Contributor
Continued Contributor

How to Rank Customers outside of Row Level Security, using RLS

Hi All, I'm not sure if this is possible, but seems like it would be a common scenario. I am ranking all our distributor customers against each other within a Power BI report. So, for example, we may have 100 distributor territories (APR) and I want to rank each territory among the whole list. This works great when I have access to the entire dataset. However, I just discovered - even though using ALL and RANKX - when somebody with row level security who has access to three APRs, for example, looks at the ranking, it shows only their three APRs. I understand why this happens now, but is there a way around it within Power BI? I have many different data sources with rankings - from SQL server table, to Excel files in different locations. So to take the ranking back to the dataset(s) will be very time consuming.

Here's my formula (if more than one APR is selected, it says "Select one APR", otherwise, it calculates and shows the rank):

 

Rank YTD Order % Growth =
IF(HASONEFILTER('Bridge'[APR]),
RANKX(ALL('Bridge'[APR]), [YTD Order $ to Prior Yr (%)], , DESC),
"Select one APR")
1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Shelley ,

AFAIK, ALL function works with different level filters and slicer. RLS filters are filtered on data model level, you can't do calculation between filtered and unfiltered records based on RLS filter.

You can consider to duplicate a table without relationship to original table and stored full records, then you can simply do calculate with these backup records and filtered records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @Shelley ,

AFAIK, ALL function works with different level filters and slicer. RLS filters are filtered on data model level, you can't do calculation between filtered and unfiltered records based on RLS filter.

You can consider to duplicate a table without relationship to original table and stored full records, then you can simply do calculate with these backup records and filtered records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.