Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 abc@gmail.com sees only 1234. this is easy setup a role user ID = Userprincipalname()

 

My question - when users 123@gmail.com and 987@gmail.com login, they should see all the data in department. i.e rls shouldnt be applied.

 

DepartmentUser ID
1234abc@gmail.com
1235xyz@gmail.com
All123@gmail.com
1236qwe@gmail.com
All987@gmail.com
1 ACCEPTED SOLUTION
Adescrit
Impactful Individual
Impactful Individual

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.

 RLS.JPG

 

 

 

 

 

 

When you publish your report to Power BI service, you can add users 123@gmail.com and 987@gmail.com to the "All" role, and no filters will be applied when they access this Power BI report. 


Did I answer your question? Mark my post as a solution!
My LinkedIn

View solution in original post

6 REPLIES 6
Adescrit
Impactful Individual
Impactful Individual

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.

 RLS.JPG

 

 

 

 

 

 

When you publish your report to Power BI service, you can add users 123@gmail.com and 987@gmail.com to the "All" role, and no filters will be applied when they access this Power BI report. 


Did I answer your question? Mark my post as a solution!
My LinkedIn
Anonymous
Not applicable

Thanks for the response , is there a way to use if else condtion in the same role ? instead of creating two roles ?

Adescrit
Impactful Individual
Impactful Individual

Not that I'm aware of. Creating a new, blank role for any users who should see unfiltered data would be the simpler option.


Did I answer your question? Mark my post as a solution!
My LinkedIn
Anonymous
Not applicable

Thanks for the solutions!

Hi @Anonymous ,

 

I don't think so. Why you don't want to create multiple role?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.