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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Manager RLS

Hi All,

 

I'm stuck while creating the RLS for the Managers.

 

I have a situation where I have Manager ID in my User table and if a manager logs in he/she should see the data for their reportees. But I'm not getting the DAX expression to fulfill this requirement.

 

Can someone help me with If/else expression in the RLS.

 

My Relatonship:

 

Himanshu_13_0-1633164327334.png

RLS condition I creatd to view indivisual data:

 

Himanshu_13_1-1633164395829.pngHimanshu_13_2-1633164409944.png

 

My User Table:

 

Himanshu_13_3-1633164503005.png

 

I'm trying to create a role where if I'm a salesperson i'll see only my data i.e MyOwn and if I'm a manager I should see data of all my reportees.

 

Regards,

Himanshu

6 REPLIES 6
StefanoGrimaldi
Resident Rockstar
Resident Rockstar

can you share your model with dummy data to have a look at it ? and send it back with the corrected observations 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Anonymous
Not applicable

Hi,

 

You may find the sample file on the below location.

 

I have created the 4 roles as per my undertsanding. Kindly check if its correct and if not let me know any other way to build the role.

 

https://drive.google.com/file/d/1CROfe90HyCyYLjh856ABdJ2gYnpkpnhj/view?usp=sharing

 

Regards,

Himanshu

Anonymous
Not applicable

Hi @Anonymous 

I checked your screenshot and I find you lose a ")" when you are using userelationship function in your code. This should cause the error. 

Here are some blogs about dynamic RLS in Power BI.

For reference:

Dynamic Row Level Security with Power BI Made Simple

Dynamic Row Level Security with Organizational Hierarchy Power BI

 

Best Regards,
Rico Zhou

 

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

Anonymous
Not applicable

Can't we use UseRelationship in the RLS?

 

I'm trying to setup a condition using "UseRelationship" and its giving me error.

Himanshu_13_0-1633246488931.png

 

StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hey, 

first check your relantionship have to be both way and have the "Apply security filterin both directions", also in the manager should be enought setting the rules definition for the fact table no need to set rules for the dimension table itself. 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Anonymous
Not applicable

@StefanoGrimaldi I have set the relationship both ways but couldn't understand the 2nd part.

Can you explain in detail.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.