Row-Level Security (Advanced)0%

Row-Level Security (Advanced)

Beginner12 min read•Updated: Jul 11, 2026
Study MaterialsCheatsheet

Advanced Row-Level Security: Multi-Role Intersections & Hierarchy Security

In enterprise deployments, security requirements rarely consist of simple static filters. Global organizations require matrix security models:

  • A user can only see data for their assigned region AND their specific product line.
  • A regional manager must see data for their direct subordinates and all downstream employees across an organizational hierarchy tree.

1. Multi-Dimensional RLS: The Intersection Dilemma

When an employee has multiple access constraints (e.g., Region = North, Department = Healthcare):

The Common Enterprise Mistake:

Creating two separate roles:

  • Role 1: North_Role (Filter: [Region] = "North")
  • Role 2: Healthcare_Role (Filter: [Department] = "Healthcare")
Important Warning
When a user is assigned both roles, Power BI combines roles with an OR UNION, NOT an AND! The user will see ALL North data (regardless of dept) PLUS ALL Healthcare data (regardless of region)!

The Secure Solution: Single Compound Role

DAX
-- Enforces true dimensional intersection (AND)
[Region] = "North" && RELATED(Dim_Product[Department]) = "Healthcare"

2. Manager Hierarchy Security with PATHCONTAINS

To allow managers to automatically see data for themselves and everyone reporting up through their chain of command:

DAX
-- Dynamic RLS filter applied on Dim_Employee:
VAR CurrentUserEmail = USERPRINCIPALNAME()
VAR CurrentUserEmployeeID =
LOOKUPVALUE(
Dim_Employee[EmployeeID],
Dim_Employee[Email],
CurrentUserEmail
)
RETURN
PATHCONTAINS(
Dim_Employee[EmployeePath],
CurrentUserEmployeeID
)

How It Works:

  1. 1
    USERPRINCIPALNAME() retrieves the login email of the user viewing the report.
  2. 2
    LOOKUPVALUE identifies their internal EmployeeID.
  3. 3
    PATHCONTAINS checks if their EmployeeID appears anywhere in the EmployeePath of any row!
  4. 4
    Result: The manager automatically sees data for their entire organization without creating thousands of individual static roles!

Interactive Quiz

Multiple Choice Questions

Question 1
If a user is assigned to two separate RLS roles in the Power BI Service—one filtering Region="West" and the other filtering Dept="Electronics"—how does Power BI evaluate their access?
Question 2
How does the PATHCONTAINS function automate hierarchy security for managers in Power BI?
Question 3
Which DAX function retrieves the authenticated Microsoft Entra ID (Azure AD) user email address inside a security formula?
Question 4
What happens if LOOKUPVALUE fails to find the current user's email in the security mapping table during RLS evaluation?
Question 5
Why is dynamic hierarchy RLS using PATHCONTAINS superior to static role assignment in an enterprise with 5,000 employees?

Next Lesson

Object-Level Security

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

PrevNext