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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
user131313
Frequent Visitor

Dynamic Row Level Security with multiple user tables

Hi,

 

The logic is really escaping me on how I can deal with this issue and I can't find anything that is exactly the same so I'm hoping someone can help!

 

I have a list of users for my Power BI report. Some of them will need access to All rows in my fact table, some will need to have a subset, based on my [department] field, held both in my user table and in my fact table. I need it to work using dynamic row level security.

 

I've tried separating out the users into two tables and then creating a join from the "Full Access User" table to the Fact Table on a field I have just called "All" in both tables. I then link the "Subset User" table to the Fact Table on the "department" field. That does cause a many to many relationship though in both cases which limits what I can do.

 

When I come to look at the Roles to implement the security - using two user tables doesn't exactly work as its an AND between two tables and it just shows no data for any user.

 

I tried this separation of tables as I read that USERELATIONSHIP type logic wouldn't work with RLS? And the only solution I can think is to create two different joins to the fact table? But I could have one table with all the users if that's a better solution and it could work somehow.

 

Any pointers would be very very much appreciated! I think my main issue is how the tables join together, which seems simple but isn't?

 

1 ACCEPTED SOLUTION
user131313
Frequent Visitor

Thanks for this! I was looking for some way around the many to many solution but I couldn't find one. To get around the need for two tables etc I just blew out my user table to have one line per "department" that I'm joining back to my main fact table on. This seems to work, I'd like to get around the many to many relationship but I'm not sure there is a solution!

View solution in original post

2 REPLIES 2
user131313
Frequent Visitor

Thanks for this! I was looking for some way around the many to many solution but I couldn't find one. To get around the need for two tables etc I just blew out my user table to have one line per "department" that I'm joining back to my main fact table on. This seems to work, I'd like to get around the many to many relationship but I'm not sure there is a solution!

lbendlin
Super User
Super User

Your RLS reference table should have a department column and a "See all"  column.  Then your RLS rule can be 

 

[Department] = "xxx" || [See all]

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.