Forum Discussion
Implement dynamic security with multiple columns
Hi All,
I need to implement dynamic security filters for users based on data in 3 columns of my dataset. I dont have any hierarchy defined at table level for these, but virtually it can be considered hierarchical in ascending order. Sample data below for more clear understanding:
| Manager1 | Manager2 | Manager3 |
| abc | abc | abc |
| abc | xyz | ljk |
| abc | xyz | def |
| bde | bde | ijf |
| bde | asd | dsd |
| cde | dee | dds |
If Manager1 has no hierarchy, its repeated for Manager2&3, and similary for Manager2. Now I need to implement dynamic rls for this, like the UserName() if matches any of the 3 managers, then it should show those records only (there are other columns as well in dataset). Is it possible to compare input UserName() against 3 columns from the same dataset? If yes how?
3 Replies
- parry2kSuper User
Anonymous you can apply any business logic in RLS, read my blog post here.
of course it is not direct solution to your question, but can give you an idea of how you can implement RLS in your model.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
- v-lili6-msftCommunity Support
HI Anonymous
You could define a rule as below in RLS
[Manager1] = UserName()||[Manager2] = UserName()||[Manager3] = UserName()https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls
Regards,
Lin