Forum Discussion
AnthonyJoseph
2 years agoResolver III
Bypass RLS through DAX in Manage roles section
Hello Community, In our dashboard are currently using RLS (user email = userprincipalname()) to show data based on the logged in user. Now, we need to bypass this RLS when the user is from "Admin...
MargusMartsepp
2 years agoNew Member
You can use an OR condition in the DAX formula to check if the user is part of the "Admin" team. If they are, the RLS filter will not be applied.
=
(
[user email] = USERPRINCIPALNAME()
||
LOOKUPVALUE('Admin_RolesAndPermissions'[Team], 'Admin_RolesAndPermissions'[user email], USERPRINCIPALNAME()) = "Admin"
)Just as a reminder to implement this, you would:
- Go to the "Modeling" tab in Power BI Desktop.
- Click on "Manage roles."
- Create a new role or edit an existing one.
- Paste the DAX filter expression next to the table where you want to apply RLS.
- Save and close the "Manage roles" window.
- Before publishing, you can view the report as roles to test the RLS.