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)!
To allow managers to automatically see data for themselves and everyone reporting up through their chain of command:
1-- Dynamic RLS filter applied on Dim_Employee:
2VAR CurrentUserEmail = USERPRINCIPALNAME()
3VAR CurrentUserEmployeeID =
4 LOOKUPVALUE(
5 Dim_Employee[EmployeeID],
6 Dim_Employee[Email],
7 CurrentUserEmail
8 )
9RETURN
10PATHCONTAINS(
11 Dim_Employee[EmployeePath],
12 CurrentUserEmployeeID
13)
How It Works:
1
USERPRINCIPALNAME() retrieves the login email of the user viewing the report.
2
LOOKUPVALUE identifies their internal EmployeeID.
3
PATHCONTAINS checks if their EmployeeID appears anywhere in the EmployeePath of any row!
4
Result: The manager automatically sees data for their entire organization without creating thousands of individual static roles!
Interactive Quiz• Knowledge Check
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.
Test your understanding of this lesson with 5 questions. Each question has one correct answer.
12-Month Data Analysis Mastery Program
Master Full-Stack Data Analytics (Excel, SQL, Python, Power BI & Tableau)
Combine 15 complete courses, 150 chapters, 541 topics, live SQL/Power BI/Tableau dashboards, and Scikit-Learn capstones at MSK Institute Shikohabad or Live Online.