Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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:
RLS condition I creatd to view indivisual data:
My User Table:
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
can you share your model with dummy data to have a look at it ? and send it back with the corrected observations
Proud to be a Super User!
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
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.
Can't we use UseRelationship in the RLS?
I'm trying to setup a condition using "UseRelationship" and its giving me error.
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.
Proud to be a Super User!
@StefanoGrimaldi I have set the relationship both ways but couldn't understand the 2nd part.
Can you explain in detail.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 41 | |
| 33 | |
| 29 | |
| 27 |
| User | Count |
|---|---|
| 132 | |
| 112 | |
| 58 | |
| 57 | |
| 57 |