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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
johnmenx
Frequent Visitor

Dynamically changing hierarchy in a table according to the told that logs in.

I have a table with the hierarchy A B C D E. And sales for each of these. Now A is the top level management, B is next level under A, etc.

So when an A logs in, he needs to see B, C, D, E with thier sales numbers in the table. And because RLS is applied he will only see the data for basically everyone in his team under him. 

If one of the Bs logs in, they see the table as C, D, E and if one of the Cs logs in they will see the table as D, E

For example:
if a regional manager logs in. He needs to see the table as the data for all the area managers under him and then he can drill down the hierarchy to go further.  If an area manager logs in instead, he needs to see the default view starting with the district managers.

Using RLS you can only filter the data that one sees, but you cannot set the default view with which the pages and the tables render. Is there any workaround for this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @johnmenx ,

I created some data:

Table1:

vyangliumsft_0-1705029666588.png

Table2:

vyangliumsft_1-1705029666589.png

Here are the steps you can follow:

1. Modeling – Manage roles – Create – Table filter Dax expression.

PATHCONTAINS('Table1'[Manager ID],
MAXX(
   FILTER(
        'Table1',[Email]=USERPRINCIPALNAME()),'Table1'[ID]))

vyangliumsft_2-1705029679906.png

2. View as roles.

vyangliumsft_3-1705029679907.png

3. Result:

vyangliumsft_4-1705029705238.png

Refer to :

Dynamic Row Level Security with Organizational Hierarchy Power BI - RADACAD

This is the related document, you can view this content:

Positions in Many-to-Many Relationship - Part 1 - RADACAD

Dynamic Row Level Security with Manager Level Access in Power BI - RADACAD

 

Best Regards,

Liu Yang

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

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @johnmenx ,

I created some data:

Table1:

vyangliumsft_0-1705029666588.png

Table2:

vyangliumsft_1-1705029666589.png

Here are the steps you can follow:

1. Modeling – Manage roles – Create – Table filter Dax expression.

PATHCONTAINS('Table1'[Manager ID],
MAXX(
   FILTER(
        'Table1',[Email]=USERPRINCIPALNAME()),'Table1'[ID]))

vyangliumsft_2-1705029679906.png

2. View as roles.

vyangliumsft_3-1705029679907.png

3. Result:

vyangliumsft_4-1705029705238.png

Refer to :

Dynamic Row Level Security with Organizational Hierarchy Power BI - RADACAD

This is the related document, you can view this content:

Positions in Many-to-Many Relationship - Part 1 - RADACAD

Dynamic Row Level Security with Manager Level Access in Power BI - RADACAD

 

Best Regards,

Liu Yang

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

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors