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
aolan
Frequent Visitor

RLS and Calculations Using ALL

Hi,

 

Suppose I have the locations A, B, and C. Each location has employees in it and I have applied RLS so that the employees can only see their data in their location and it is working fine. However, I have a calculated measure that uses ALL to calculate the percentile rank against all of the locations. Regardless of what location I am viewing, the percentile should stay the same (again, as it is ranked against the entire population regardless of location). And this is working fine for me as I have the ability to view all of the locations.

 

Now, I have noticed that if employee 1 from location A views the report, the value of the percentile rank changes because I assume that ALL only gets the data from location A. It is like RLS trumps the calculations inside the report. Is there any way around this?

 

Thanks!

1 ACCEPTED SOLUTION
mariussve1
Super User
Super User

Hi,

 

If you think about it, this is what you want. To create measures the measure needs to access the data it shall calculate. So, if ALL() had override RLS it means it had access to all og the data, and this means end users could see data the should not. I do understand its easy to think what happends inside a measure is not visible to end users, but as I wrote the data to calculate need to be available also to end users.

 

A work around is to create a calculated table where you eather remove all columns that identify sensitive data, like names and so on. Then dont apply rls on this table. Other work around is to create a pre aggregated table with all calculations in columns and of course remove all sensitive data and dont have rls on this.

 

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no

View solution in original post

1 REPLY 1
mariussve1
Super User
Super User

Hi,

 

If you think about it, this is what you want. To create measures the measure needs to access the data it shall calculate. So, if ALL() had override RLS it means it had access to all og the data, and this means end users could see data the should not. I do understand its easy to think what happends inside a measure is not visible to end users, but as I wrote the data to calculate need to be available also to end users.

 

A work around is to create a calculated table where you eather remove all columns that identify sensitive data, like names and so on. Then dont apply rls on this table. Other work around is to create a pre aggregated table with all calculations in columns and of course remove all sensitive data and dont have rls on this.

 

Br

Marius


Br
Marius
BI Fabrikken
www.bifabrikken.no

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.