Forum Discussion
Row Level Security & Roles
Hey kge8888, you can use IN instead of =
'Table'[Which org is the employee exiting?] IN {"1234 Sampletown Div", "1235 Sampletown Plt", "1236 Sampletown HQ"}
Note - I'm assuming the question is the name of the field in the table where you'd find those values.
You may find it easier to add a dimension table that ties the manager (their email) to the location and link that to your model (if you don't already have that) then you could use something like:
'manager_to_location_table'[manager.email] = userprincipalname()
I've found filtering based on the user principal name is better when who is allowed to see what changes from time to time. So I'll use this setup for my managers who lead specific sales teams and the RLS will filter based on their user principal name and the data refresh keeps which teams they're responsible for up to date rather than hard coding the teams (or in your example the locations) that they can see because updating RLS filters can only be done in the desktop file.
So if you have any tables that link the manager to the locations they are able to see in your tables, then filtering the user is likely better and you can create just 1 rule for managers and 1 rule for users and it's lot easier to manage long term (and that's coming from someone who did it the hard way once before where each person had their own entry in the RLS rules).
- kge88883 years agoNew Member
This also works but takes more time to enter in the full name string of each org rather than just specifying "Sampletown". I will need to read further into your filter by principal name suggestion, thank you.