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
AlexanderRbt
Helper I
Helper I

Filtering a table based on Row Level Security

Hi everybody, 

 

This may be a tricky one.

 

I would like to create a filtered table based on a table of all users (users_all). This filtering is based on a permission table that is itself filtered by Row Level Security.

 

The permissions tables is called `groups`, the filtered table is called `filtered_users` and the original user table is called `users_all`.

The RLS correctly filters my permission table.

 

I use then this syntax to filter users_all based on the values in groups[group_id]

 

 

filtered_users = CALCULATETABLE(users_all,
                                KEEPFILTERS( users_all[group_id] IN DISTINCT(groups[group_id]) )
                                )  

 

 

However, although I can see that the groups[group_id] is correctly filtered in my table view, the resulting filtered table is untouched.

 

What am I doing wrong? Is it possible that the filtered table is generated BEFORE the RLS is applied? 

 

2 REPLIES 2
lbendlin
Super User
Super User

Usually RLS is applied to an outer dimension in your data model and then propagates through all the way to the fact tables.  No need for extra measures etc.

I agree and this is how I usually use it. I have two permissions tables that are filtered by RLS. My users_all table needs to be filtered by both of these tables to create a superset (a person has to be in one OR the other table). I cannot seem to do that with the usual relationships in the data model view. If I create the two relationships, I only retain people who exist in both tables.

 

I tried to calculate a combined table with my RLS tables as filters but the filters are ignored as I described. 

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.