Forum Discussion
Row level security - column value starts with value from logged in user
- 5 years ago
Thank you for your suggestions. While they might work, I was not able to easily implement them.
What I did instead was set the RLS to filter all employees where the RBS contains the RBS of the logged in user, and then exclude the logged in user.
IF(Employees[Employee Email]=userprincipalname(),False,CONTAINSSTRING(Employees[RBS],LOOKUPVALUE(Employees[RBS],Employees[Employee Email],userprincipalname())))
rmarian - Dynamic Hierarchical RLS - https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Hierarchical-Row-Level-Security/m-p/889567#M406
Greg_Deckler Could you please elaborate how to apply this to my data? I don't have a direct child id-parent id connection between the rows, I can only get this information from the RBS column which is type string. How do I convert to path?
- Rigensis5 years ago
Resolver I
rmarian Basically you can do it, but you would need to create another column in your users table, that would contain all users that can access the particular users data.
For example,
user that has RBS of Division.Unit would only need his own email in the new column,
while a user that has RBS of Division.Unit.Department1, in the new column would have not only his own email, but also the email of the first user mentioned, as that one can also access this lower level.
basically you would have to recreate RBS column, but with user emails.
The highest level user would only have his own email in the new column, effectively only he can see the data that is connected with his RBS.
while the lowest level user in the new column would have emails of all the people that are higher up in the same RBS chain as he is, effectively giving all of them access to what he sees as well.