Forum Discussion
RLS and UserPrincipalName()
Hi folks,
I took my first foray into implementing RLS in a report that I published from PBI Desktop to our firm's Power BI Service environment, but it, unsurprisingly, hasn't been working. I've been studying a solution here:
Using the above thread, I setup a test RLS table with a handful of "authorized" users, which I would use as a filter in tandem with userprincipalname() to ensure only they can see this report. I used a variation of this DAX expression as a filter for each table in my report:
= CONTAINS('RLS', 'RLS'[Email Address], USERPRINCIPALNAME())
| User Name | Email Address |
| User 1 | user email |
| User 2 | user email |
| User 3 | user email |
Unfortunately, it doesn't work. What should this filter being set against left of the "=" sign? If its a column like [Email Address], I get errors stating the column couldn't be found and/or is now allowed in the expression. Also, the aforementioned thread suggested that the RLS I set up doesn't need to be given a relationship to any of the tables in the model, which seems contradictory to other solutions I've read (unless I missed something). Appreciate the help in understanding this better.
Best,
pb
- Anonymous4 years ago
Hi Anonymous ,
Try this in the Table Filter DAX Expression.
= [Email Address]= USERPRINCIPALNAME()Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- VahidDMSuper User
Hi Anonymous
Check this link and related blog posts as well:
https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-biIf this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
- AnonymousNot applicable
Hi Anonymous ,
Try this in the Table Filter DAX Expression.
= [Email Address]= USERPRINCIPALNAME()Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.