Forum Discussion
Dynamic Row level security issue
- 6 months ago
Thank you all for your replies.
I also tried using the below but this also didn't work.
[Email] = USERPRINCIPALNAME()
After much more investigation and google, got the below and used it and it seems to be working as expected.
[Login] == LOOKUPVALUE('Employeetable'[Login], 'Employeetable'[Email], USERPRINCIPALNAME())
Thanks all again for your inputs.
grkanth81.
Hi grkanth81,
Generally you will want to use USERPRINCIPALNAME() and user's email's for RLS.
I've never had much success with USERNAME() as it behaves inconsistently depending on how the report server is set up.
If you switch over to using USERPRINCIPALNAME() and filtering on the email column, your set up should work well.
One other thing to keep note of is that the table where you are filtering RLS on needs to have relationships to the other tables in your model for them to be filtered.