Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello Community,
I am trying to create rules using RLS where depending on the email signed in, it looks at what criterias that person belongs to and filters the data accordingly.
Lets say in my case I have 3 tables. Permission table has the user id/mail/country/team/position. I then have a country table and my data table. That data table is connected to my country table based on country code(I use this to have a country slicer to filter data by country) and the permission table is connected to the country table atm as it is the only conection I can make.
At the moment, using the USERPRINCIPALNAME() i have an rls rule so depending on the country that person is from it shows the data only for that country.
I want to create rules where if a person signs in with their username, rls checks which team that person belongs to and sees country x/y/z and if the position of that person is manager it sees EVERYTHING regardless of the country the manager is from.
I created this quick sample showing the details i would have in my permission table and in the end what i would want for them to be able to see based on the email they used to sign in.
I managed to get everything working except having issues when a user belongs to more then one office 365 group and therefore is in more then one rls rule.
How is that an issue?
Sounds straightforward. What have you tried and where are you stuck?
| User | Count |
|---|---|
| 52 | |
| 41 | |
| 32 | |
| 15 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 72 | |
| 37 | |
| 27 | |
| 24 |