Row-Level Security (RLS)
Power BI · Advanced Features
Theory
Row-level security restricts which rows of data a user can see, using the same report for everyone. In Desktop you define roles (Modeling → Manage roles), each with a DAX filter expression on one or more tables, such as [Region] = "North" on Sales. Filters on a dimension table flow through relationships to fact tables. After publishing, you assign users or security groups to each role in the Service under the semantic model's Security settings.
Static RLS hard-codes values per role. Dynamic RLS uses one role whose filter compares a column with the signed-in user, for example a UserRegion table with Email and Region, filtered by [Email] = USERPRINCIPALNAME() and related to the data. Priya, the North manager, then sees only North's three orders (₹3,200) in every visual. RLS applies to users with the Viewer role or app access; workspace Admins, Members and Contributors are not restricted by it.
Why we use it
Different people should see different data, such as their own region or customers. RLS lets one report and one model serve all of them securely instead of maintaining a copy per audience.
When to use it
Use RLS whenever data access depends on who the user is. Use dynamic RLS when there are many users or values, so you do not need a role per region. Hiding pages or using slicers is not security; RLS is.
How it works
- User opens the report
- Service checks the user's RLS role
- Is the user in a role? Yes: Apply that role's DAX filter. No: Show no data (Viewers need a role).
- Filter flows through relationships to fact tables
- Visuals show only permitted rows
Syntax
Desktop: Modeling → Manage roles → New role → table → DAX filter (e.g. [Region] = "North")
Test: Modeling → View as → choose role (and Other user for dynamic RLS)
Service: semantic model → ... → Security → add members to role
DAX: USERPRINCIPALNAME()Example
// Static role 'North Manager' on Sales
[Region] = "North"
// Dynamic role 'Region Manager' on table UserRegion(Email, Region)
[Email] = USERPRINCIPALNAME()
// UserRegion relates to a Region dimension that filters Sales
// Test: Modeling → View as → Region Manager, Other user = priya@company.in
// Cards show Total Sales ₹3,200, Orders 3Key points
- RLS roles are DAX filters defined in Desktop
- Members are assigned to roles in the Service
- Dynamic RLS uses USERPRINCIPALNAME() with a mapping table
- Test with Modeling → View as before publishing
- Workspace Admins, Members and Contributors bypass RLS