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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
TCavins
Helper V
Helper V

Row Level Security with OR

Currently have RLS working excellently! Trying to reduce the dataset size for it as every report that external people see, uses it. I want RLS to work as is for external users but want to modify the security table so I don't have to have every single combination of internal employees and SecurityGroups. We have a lot! So, I added a column to the SecurityTable to flag if they are our employee or not. The table includes all external people and every security group they have. It also include a single record for every one of our employees with 1 for InternalEmployee.

 

TestTable

FirstNameSecurityGroup
BobGroup1
TomGroup2

 

SecurityTable

UsernameSecurityGroupInternalEmployee
susan@outside.orgGroup10
tiffany@mycompany.comNULL1

 

The relationship between these two tables is preventing me from doing this as the internal employee doesn't have a securitygroup. I have SecurityTable filtering TestTable joining on SecurityGroup. Is there a way to make RLS work this way listing tiffany just once or do I need to add a record in the security table for Group1, Group2, Group3 and so on?

For this example, Tiffany would see all the FirstNames and Susan would only see Bob.

1 REPLY 1
lbendlin
Super User
Super User

Do you want to keep these tables connected or are you planning to use the RLS table in lookup mode?  When you define the DAX rules for the RLS roles you can use your OR conditional as needed. Might also get away with COALESCE.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Top Kudoed Authors