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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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