Forum Discussion
Row Level Security Errors
- 10 days ago
Hi Lucy01 ,
Create a separate DimTeam table containing one unique row per team:
DimTeam = DISTINCT('DataSheet'[Team])Then create a 1-to-many relationship:
DimTeam[Team] (1) -> DataSheet[Team] (*)Keep your Team Access table as the mapping of UserUPN -> Team. Apply RLS using USERPRINCIPALNAME() to identify the user and return their team, then filter DimTeam.
The flow should be:
User -> Team Access -> Team -> DataSheetThis avoids trying to use DataSheet[Team] directly in the RLS expression when it contains multiple rows.
Thanks!!
Hi Lucy01
While testing RLS, did you select your role and Other user as well?
When we are testing locally for any dynamic rls role, we need to select role and other user.
in the other user , enter emailid you want to test like below.
If this doesn't solve the issue, let me know.
Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
- Lucy011 month ago
Advocate I
Thank you, yes I was selecting role, other user and entering the email address as you have shown and it is returning blank data so not sure what the issue is.
- Praful_Potphode1 month ago
Super User
Hi Lucy01
Can you share data model diagram here.
ideally TeamAccess should be disconnected table.
Datasheet should be connected to other tables in the model.
Please give kudos or mark it as solution once confirmed.
Thanks and Regards,
Praful
- Lucy011 month ago
Advocate I
Thank you, here is a mock up of the model view showing the different data tables. The Main Data Sheet contains the majority of information and the Second Data Sheet is a copy of the Main Data Sheet with the columns unpivoted. I appreciate that's probably a little strange, as is having a Calendar Table and a Date Table, but it was the only way I could find to process and present the data I have.
The column names for Main Data Sheet and Second Data Sheet are the same, as are the access requirements for the Team Leaders.
Below is also an example of how the UPN & Access sheet is laid out with the Team Leader's name, their Email/UPN and the Team they have access to.
I appreciate any advice you can give me on how to set my row level access so that Team Leaders see the data from their teams only. Thank you