Implement Row-Level Security in Power BI the Right Way
Sharing one Power BI report across several regions, departments or customer teams can quickly become a security problem if every user can see every row.
Row-level security solves that problem by applying data filters according to the identity and role of the report consumer.
This practical tutorial shows how to build a scalable dynamic RLS pattern using a user-access table, model relationships and USERPRINCIPALNAME() , then test the result properly before deployment.
Keep the Same Report, Change the Data Each User Can See
RLS is useful when people should consume the same report structure but only see the rows relevant to their role, region, customer portfolio, department or business unit.
Reduce Unnecessary Data Exposure
Users see the subset of rows permitted by the security model rather than the complete dataset.
- Regional reporting
- Department reporting
- Account-manager portfolios
- Customer-facing analytics
Avoid Duplicated Reports
A well-designed RLS model can remove the need to maintain separate report copies for every audience.
- One semantic model
- One measure set
- One visual design
- Different permitted rows
Centralise Access Logic
Dynamic RLS can use a maintained mapping table so access changes do not require a new role for every user.
- User-to-region mapping
- User-to-team mapping
- Many users per region
- Many regions per user
Support Repeatable Testing
Roles can be tested against representative identities before the report is released to the wider business.
- Desktop role testing
- Service role testing
- Expected-row checks
- Access regression tests
Static RLS vs Dynamic RLS
Both approaches have valid use cases, but dynamic RLS is usually easier to scale when access rules differ by user and change over time.
Static RLS
Static RLS creates explicit roles with fixed filter rules. A user is then assigned to the appropriate role.
- Easy to understand for a small number of roles
- Suitable for stable, broad access groups
- Can become difficult to maintain at scale
- Role proliferation can create administration overhead
Dynamic RLS
Dynamic RLS identifies the signed-in user and uses a mapping table to determine which security keys that identity may access.
- One role can support many users
- Users can be mapped to one or several regions
- Access can be maintained as data
- Works well with a governed access-management process
Build Security into the Semantic Model
The dynamic pattern becomes much easier to reason about when the security mapping, business dimension and fact table have clear relationships.
Example access path
In this example, a user's permitted region keys flow through the model to filter the sales fact table.
RegionKey
RegionName
Area
Country
RegionKey
CustomerKey
SalesAmount
Why this pattern scales
The role only needs to identify the current user. The mapping table decides which region keys belong to that identity, and normal relationships carry the filter into the report data.
If one user needs access to several regions, store several rows for that user in the access table rather than creating special-case DAX for that individual.
Implement Dynamic RLS from Start to Finish
The example below secures regional sales data, but the same pattern can be adapted to departments, account portfolios, legal entities and other business dimensions.
Define the access requirement before writing DAX
Write down the business rule in plain English. For example: regional managers should see only regions assigned to them, while the national sales manager should see all assigned regions through the same mapping structure.
- Who are the report consumers?
- What business key controls access?
- Can one user have several permitted keys?
- Who owns access changes?
Create the user-access mapping table
Build a table with one row for every permitted user-and-security-key combination.
A user with three permitted regions should therefore have three rows.
UserPrincipalName RegionKey ----------------------------- --------- manager.north@example.com R001 manager.north@example.com R002 manager.scotland@example.com R005 national.sales@example.com R001 national.sales@example.com R002 national.sales@example.com R005
Create the relationships that carry the security filter
Relate the access table to the secured dimension using the business key, then relate that dimension to the fact table through the normal model design.
- UserAccess[RegionKey] → DimRegion[RegionKey]
- DimRegion[RegionKey] → FactSales[RegionKey]
- Keep the relationship path simple and intentional
- Avoid adding bidirectional security filtering without a clear reason
Create one dynamic RLS role
In Power BI Desktop, create a role and apply the identity filter to the UserAccess table.
UserAccess[UserPrincipalName] = USERPRINCIPALNAME()
The role now filters the access table to the rows for the signed-in user.
The permitted region keys then flow through the model relationships.
Test with View as in Power BI Desktop
Use the role-testing feature in Power BI Desktop and enter representative user identities where appropriate.
Confirm that each test identity sees exactly the expected regions and no others.
- Test a single-region user
- Test a multi-region user
- Test a user who should see no rows
- Test totals, drill-through and tooltips
Publish the semantic model and assign role members
Publish the model and report, then manage security on the semantic model in the Power BI service.
Assign the intended users or approved groups to the dynamic role.
- Prefer governed groups where appropriate
- Keep role membership separate from report design
- Document who can change role membership
- Review access when teams or responsibilities change
Test the published role in the Power BI service
Use the service's Test as role capability to verify that the published model behaves as expected with the assigned role and identity logic.
- Confirm expected regions are visible
- Confirm prohibited regions are absent
- Confirm total values change correctly
- Confirm the production report uses the intended semantic model
Check workspace permissions carefully
This is one of the most important deployment checks.
Power BI RLS is enforced for users with Viewer permissions.
It does not restrict workspace Admins, Members or Contributors because those roles have edit-level access to the content.
Document and monitor the access process
Treat the security mapping as a controlled business process.
Define who adds users, who approves access, how leavers are removed and how exceptions are reviewed.
- Named access owner
- Documented approval route
- Regular access review
- Repeatable test cases
- Clear response to failed or unexpected access
Test More Than the Happy Path
Security testing should include permitted users, users with multiple access keys and identities that should not return any data at all.
Single-region user
Confirm that every visual, total and detail page is restricted to one permitted region.
Positive testMulti-region user
Confirm that the user receives the union of all mapped regions without leaking unrelated rows.
Mapping testUnmapped user
Confirm that an identity without an authorised mapping does not unexpectedly receive broad access.
Negative testDrill-through page
Validate drill-through and detail views, not just the landing page of the report.
Feature testExport scenario
Confirm exported data follows the same permitted view expected for the report consumer.
Output testPermission change
Change a mapping deliberately and confirm the updated access is reflected after the relevant refresh process.
Change testRLS and Workspace Roles: Know the Boundary
The semantic-model role is only part of the security design. Workspace permissions determine whether RLS is actually enforced for a user consuming the content.
Viewer
RLS is enforced for users consuming content with Viewer permissions.
Contributor
Contributors have edit-level workspace access, so RLS does not restrict them in the same way as Viewers.
Member
Members can collaborate on workspace content and are not protected by RLS as ordinary report consumers.
Admin
Administrators control the workspace and are not restricted by semantic-model RLS.
Avoid These Security Pitfalls
Many RLS issues come from model design or workspace permissions rather than from the DAX expression itself.
| Problem | Why It Matters | Better Approach |
|---|---|---|
| Creating a role for every individual | Role administration becomes difficult as the user population grows or territories change. | Use a dynamic user-access table where the business rule permits it. |
| Securing by labels instead of keys | Renamed regions or inconsistent spelling can break access logic unexpectedly. | Use stable surrogate or business keys for the security relationship. |
| Assuming hidden pages are secure | Hiding report elements changes presentation, not row-level data access. | Enforce data security in the semantic model. |
| Giving consumers Contributor access | RLS is not enforced for workspace Contributors. | Use Viewer/app distribution for ordinary secured consumers. |
| Testing only one user | Single-user testing can miss multi-key, unmapped or exception scenarios. | Maintain a small regression test matrix. |
| Using unnecessary bidirectional security filters | Complex filter paths can make security logic harder to understand and troubleshoot. | Keep the model directional and simple unless the security requirement genuinely needs more. |
Power BI Row-Level Security FAQs
What exactly does Power BI row-level security restrict?
What is the difference between static and dynamic RLS?
Why use USERPRINCIPALNAME()?
Can one user have access to several regions?
Does RLS apply to workspace Members and Contributors?
Should I use security groups for role membership?
Is RLS enough to hide sensitive columns?
How can Smart Statistics help?
Technical references
This tutorial is aligned with current Microsoft guidance for Power BI row-level security, workspace roles and RLS modelling practices.
Always check current tenant-specific behaviour, licensing and product documentation before a production rollout.
Need Confidence That the Right People See the Right Data?
Smart Statistics helps UK businesses design Power BI solutions that are not only useful and attractive, but also governed, maintainable and secure by design.
We can review your semantic model, implement dynamic RLS, strengthen workspace permissions, improve data modelling and help establish repeatable security testing.