Request a Call Back

How do I implement Dynamic Row Level Security (RLS) in Power BI using an Organizational Hierarchy?


I need to set up a report where managers can only see the data for their direct reports, and department heads can see everything in their branch. I have a 'User' table with email addresses and 'ManagerID' columns. What is the best DAX pattern using the PATH function to ensure security is applied correctly without creating hundreds of different roles manually in the service?


   2025-01-12 in Data Science by Michael Scott | 9419 Views


All answers to this question.


Dynamic RLS is the way to go. You’ll want to create a calculated column using PATH(User[EmployeeKey], User[ManagerKey]) to flatten the hierarchy. Then, in your RLS role, use a filter like PATHCONTAINS(User[PathColumn], LOOKUPVALUE(User[EmployeeKey], User[Email], USERPRINCIPALNAME())). This checks if the logged-in user's ID exists anywhere in the path of the record being viewed. It’s highly scalable because you only need one single role defined in Power BI Desktop, and the logic automatically adapts based on whoever is viewing the report in the cloud.

   Answered 2025-02-05 by Patricia Hall


This approach makes sense for viewing data, but how does it impact the performance of the report if the hierarchy is 10 or 15 levels deep and we have thousands of employees?

   Answered 2025-02-08 by Kevin Peterson

  • Performance shouldn't be an issue if your User table is indexed correctly at the source. The PATH function is calculated during the data load (Import mode), so the heavy lifting is done before the user even opens the report. During runtime, PATHCONTAINS is very efficient. We use this for a 50,000-person organization with 12 levels of management, and the overhead is barely noticeable. Just ensure your relationships between the User table and the Fact table are simple and direct.

       Commented 2025-02-12 by Michael Scott


Make sure you test this using the "View as Role" feature in Desktop while entering a specific user's email to verify the hierarchy logic works for different levels.

   Answered 2025-02-15 by Nancy Young

  • Great tip, Nancy. Also, remember that RLS doesn't apply to Workspace Admins or Members—only to people with "Viewer" roles. I learned that the hard way!

       Commented 2025-02-18 by Patricia Hall



Write a Comment

Your email address will not be published. Required fields are marked (*)




Suggested Questions

Introduction to Project Management..
Posted 2026-07-07 by learnersera.
Balancing Link Metrics With Structural Entity Maps..
Posted 2025-05-12 by learnersera.
Balancing Link Metrics With Structural Entity Maps..
Posted 2025-05-12 by learnersera.
Impact of Entity Authority on Organic Competitive..
Posted 2025-01-04 by learnersera.
Backlinks vs Entity Authority for SEO Rankings..
Posted 2025-04-14 by learnersera.
How are modern agile organizations evaluating scrum..
Posted 2025-07-19 by learnersera.
Is a specialized technical degree required to..
Posted 2025-10-05 by learnersera.
How heavily do hiring managers weigh professional..
Posted 2025-09-12 by learnersera.

Disclaimer

  • "PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc.
  • "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA.
  • COBIT® is a trademark of ISACA® registered in the United States and other countries.
  • CBAP® and IIBA® are registered trademarks of International Institute of Business Analysis™.

We Accept

We Accept

Follow Us

 facebook icon
 twitter
linkedin

Instagram
twitter
Youtube

Quick Enquiry Form

WhatsApp Us  /      +1 (713)-287-1187