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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Rogermiddleton
Regular Visitor

Dynamic RLS with 2 different roles

Hi everyone,

 

I have an employee table that filters the other fact tabel. We want to implement RLS on the employee table as following:

NameE-mailE-mailmanagerIsManager
Fred[email protected] 1
James[email protected][email protected]0
Nancy[email protected][email protected]0

 

Role 1: Employee

Should filter the employee table as: [E-mail] = USERPRINCIPALNAME ()

 

Role 2: Manager 

Should filter the employee table as: [E-mail manager] = USERPRINCIPALNAME ()

 

I am using E-mail Distribution lists in the security of the Dataset. We only have lists which contain both employees and managers. So if we make 2 different roles and add the list to both roles we get an error message.

 

What we want to do now is implement 1 dynamic RLS role with the help of the added column [IsManager] (0 or 1). So USERPRINCIPALNAME should check column [IsManager] and then apply Role 1 Filter OR Role 2 Filter. It shouldn't filter on the [IsManager] column.

 

Is this possible and if yes what should the DAX formula be? Help is much appreciated!! (and if an other solution better fits our problem, we are happy to know)

 

Kind regards,

 

Roger

1 ACCEPTED SOLUTION

Hi, @Rogermiddleton 

 

After my test, you can try this:

 

[E-mail] = USERPRINCIPALNAME () || [E-mailmanager] = USERPRINCIPALNAME () 

 

 

Best Regards,

Community Support Team _Janey

If this post helps, then please consider Accept it as the solution to help the other members find it more.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Rogermiddleton , refer if this blog can help

https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

 

Thanks for your reply. I found this blog, but the solution described lets a manager see the data of everyon below him/her in the entire path. So also 2/3 levels lowel. This doesn't work for us. The manager is only allowed to see the data from the employees directly 1 level below him/her.

 

Roger

Hi, @Rogermiddleton 

 

After my test, you can try this:

 

[E-mail] = USERPRINCIPALNAME () || [E-mailmanager] = USERPRINCIPALNAME () 

 

 

Best Regards,

Community Support Team _Janey

If this post helps, then please consider Accept it as the solution to help the other members find it more.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors