Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

RLS help!

I have a table "RLS" with two columns Department and User ID. I have a requirement where when a user logs in Power BI service they should only see data related to their department .

Eg [email protected] sees only 1234. this is easy setup a role user ID = Userprincipalname()

 

My question - when users [email protected] and [email protected] login, they should see all the data in department. i.e rls shouldnt be applied.

 

DepartmentUser ID
1234[email protected]
1235[email protected]
All[email protected]
1236[email protected]
All[email protected]
  • Hi,

     

    You can create multiple roles in Power BI desktop. So in your example you might want to create the following roles:

    1. Department: This is where you set up your RLS as specified below. Filter user ID = Userprincipalname()
    2. All: Create a role that does not contain any filters.

     

     

     

     

     

     

     

    When you publish your report to Power BI service, you can add users [email protected] and [email protected] to the "All" role, and no filters will be applied when they access this Power BI report. 

6 Replies