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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
DiKi-I
Post Patron
Post Patron

Row level security

Hi,

I've a measure which is calculated from one of the table which is in direct mode. I've craeted a measure which has row level security on employees. I also have another measure which show total but that is also getting filtered for the logged in employee. Is there a way so that I cannot have row level security on the total measure? The table is in direct query mode in power bi.

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

HI @DiKi-I ,

DirectQuery mode with Row-Level Security (RLS) applied, all measures—including totals—are inherently affected by the security filters unless explicitly handled. To bypass RLS for a specific measure like your total, you can create a separate measure using the ALL() or REMOVEFILTERS() function to ignore the RLS filter on the employee table. For example:

Total_Without_RLS = CALCULATE([YourMeasure], REMOVEFILTERS(EmployeeTable))

 

However, be aware that this will only work if the RLS is not enforced at the data source level (e.g., via SQL views or server-level security). If it is purely Power BI-managed RLS, this method should allow you to show unfiltered totals even in a DirectQuery model.

 

Passionate about leveraging data analytics to drive strategic decision-making and foster business growth.

Connect with me on LinkedIn: Rohit Kumar.

View solution in original post

8 REPLIES 8
v-sdhruv
Community Support
Community Support

Hi @DiKi-I ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution  so other members can easily find it.
Thank You

ribisht17
Community Champion
Community Champion

Hi @DiKi-I 

 

Step 1

Create an isolated fact table which can capture the Measure 

 

ribisht17_1-1745665393011.png

 

 

Step 2

 

Any DAX implementation suggested might not be effective because Row-Level Security takes precedence in the order of operations. As a result, changes to the context through DAX will not have an impact, since it operates on data that has already been filtered by the security layer, hence Step 1 is needed

 

 

 

 

ribisht17_0-1745665335734.png

 

Probably same suggestion as @lbendlin 

 

Regards,

Ritesh

Community Champion

Please mark the answer if helpful so that it can help others

Dance-Sing with Data Projects - YouTube

 

v-sdhruv
Community Support
Community Support

Hi @DiKi-I ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution  so other members can easily find it.
Thank You

v-sdhruv
Community Support
Community Support

Hi @DiKi-I ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution  so other members can easily find it.
Thank You

PijushRoy
Super User
Super User

Hi @DiKi-I 

CALCULATE(SUM(Table[Column]), ALL(Table))


The ALL() function removes all filters, including those imposed by RLS, and ensures the total is calculated across all rows in the table.

Leverage a disconnected table: Create a separate table or measure that is not tied to RLS settings. This disconnected table can hold the data for your total measure.

 

Use the REMOVEFILTERS function: If you want to keep the ability to selectively apply filters, you can use REMOVEFILTERS instead of ALL, which removes specific filters from your calculations while retaining others.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





rohit1991
Super User
Super User

HI @DiKi-I ,

DirectQuery mode with Row-Level Security (RLS) applied, all measures—including totals—are inherently affected by the security filters unless explicitly handled. To bypass RLS for a specific measure like your total, you can create a separate measure using the ALL() or REMOVEFILTERS() function to ignore the RLS filter on the employee table. For example:

Total_Without_RLS = CALCULATE([YourMeasure], REMOVEFILTERS(EmployeeTable))

 

However, be aware that this will only work if the RLS is not enforced at the data source level (e.g., via SQL views or server-level security). If it is purely Power BI-managed RLS, this method should allow you to show unfiltered totals even in a DirectQuery model.

 

Passionate about leveraging data analytics to drive strategic decision-making and foster business growth.

Connect with me on LinkedIn: Rohit Kumar.

PijushRoy
Super User
Super User

Hi @DiKi-I 

CALCULATE(SUM(Table[Column]), ALL(Table))
The ALL() function removes all filters, including those imposed by RLS, and ensures the total is calculated across all rows in the table.

Leverage a disconnected table: Create a separate table or measure that is not tied to RLS settings. This disconnected table can hold the data for your total measure.

 

Use the REMOVEFILTERS function: If you want to keep the ability to selectively apply filters, you can use REMOVEFILTERS instead of ALL, which removes specific filters from your calculations while retaining others.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





lbendlin
Super User
Super User

Row Level Security is applied to rows, before your measure is calculated.  You would need to have two fact tables, one with RLS applied, and one anonymized without RLS.  Then you can use the second table for the totals.

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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