Michael Tall — Header
Analyst reviewing role-based data access

Avoid RLS Failures: 4 step Power BI framework for governance

Row-level security in Power BI restricts what data a user sees within a shared report by filtering rows based on their identity, not by hiding pages or visuals. Getting it right follows four steps: define roles and DAX filter rules in Power BI Desktop, publish the model, assign Microsoft Entra users or groups to those roles in the Power BI service, then validate everything with Test as role. RLS only governs data rows, and it only holds up when the person viewing the report has Viewer permission rather than edit access.


TL;DR:

  • RLS relies on Microsoft Entra groups and DAX filters, which must be correctly assigned and tested in both Desktop and the Power BI service for effective security.
  • Using static rules is suitable for a few fixed audiences, while dynamic rules with user mapping tables scale better when managing many users or changing organizations.
  • Enforcement must be validated with Test as role in the service, and permission levels above Viewer can bypass RLS, making careful access management crucial.
  • RLS performance depends on applying filters to dimension tables with relationships, avoiding expensive functions like LOOKUPVALUE inside filter rules.
  • In complex scenarios like DirectQuery or Analysis Services, RLS enforcement moves to the data source, requiring coordination with DBAs and careful handling of authentication and SSO.

Datataal
Build More Reliable Data Governance
Datataal designs scalable Microsoft Fabric architectures that simplify analytics, strengthen governance, and support better business intelligence.

Explore Datataal

Table of Contents

What is RLS in Power BI and how does it actually work?

Row-level security filters the rows a user can query, evaluated at the semantic model layer rather than the report layer. Two viewers can open the identical report and see entirely different numbers, because the model itself decides what each identity is allowed to read before the visuals ever render.

That distinction trips up a lot of people new to the concept. RLS is not a report feature you toggle on a page. It’s a security layer baked into the semantic model, meaning the same protection applies whether someone opens the report in Power BI service, embeds it in an app, or hits the dataset through Analysis Services connectivity. Once a rule says a user only sees the “North” region, that holds true everywhere the model is consumed.

The mechanism is Microsoft Entra security objects, specifically users and groups, mapped to roles you define. Each role carries one or more DAX filter expressions. When a user opens the report, Power BI checks their identity against role membership, applies the matching filter, and returns only the rows that pass.

Where the standard workflow comes from

Microsoft’s own guidance lays out the implementation workflow in four stages: define roles and rules in Desktop, publish the model, assign Entra users or groups to roles in the service, and validate using Test as role. Every organisation Datataal has advised eventually converges on some version of this sequence because skipping a step (usually validation) is where most production incidents originate.

Four-stage Power BI RLS workflow

Define roles and rules in Power BI Desktop

Everything starts in Power BI Desktop, on the Modeling ribbon, under Manage roles. This is where you create the containers (roles) that will later map to real people in the service.

  1. Open Manage roles. Click Modeling > Manage roles > Create. Give the role a descriptive name such as “SalesManagers_West” rather than something generic like “Role1”, because you’ll be reading this name in the service months later.
  2. Pick the table to filter. Select the table you want to restrict, usually a dimension table like Region, Customer, or Department, and apply a filter expression to it.
  3. Choose your editor. The default filter editor lets you pick values from a dropdown for simple static filters. Switch to the DAX editor when you need dynamic logic, string functions, or references to other columns.
  4. Write the rule as a row-context expression. Every rule is a DAX expression evaluated per row, returning TRUE or FALSE. A row survives the filter only when the expression evaluates to TRUE for that row.
  5. Leave admin roles rule-free. A role with zero rules attached grants full, unfiltered access. This is deliberate; it is how you create an “Admin” or “Everything” role for internal teams who need to see all data.

The row-context detail matters more than it first appears. [Region] = "West" is not a query filter, it’s a test applied individually to every row in the table, which is why performance depends so heavily on which table carries the rule.

Common DAX patterns for RLS: static, dynamic and embedded scenarios

Three patterns cover almost every real deployment, and picking the wrong one for your scale is the single most common design mistake.

  • Static rules hardcode a value, like [Region] = "West". They’re fast, simple to audit, and appropriate when you have a handful of fixed audiences that rarely change.
  • Dynamic rules with USERNAME() or USERPRINCIPALNAME() filter based on the identity of whoever opens the report, avoiding the need for one role per person. Dynamic RLS scales because it filters automatically by identity, which is essential once you’re managing dozens or hundreds of users rather than three sales regions.
  • CUSTOMDATA() reads a value passed by the application in embedded analytics scenarios, letting a host app inject an identity or attribute at connection time rather than relying on the viewer’s own Entra identity.

The USERNAME() versus USERPRINCIPALNAME() distinction catches people out constantly. In Power BI Desktop, USERNAME() returns DOMAINusername, but in the Power BI service it returns the user’s UPN instead, format-shifting between the two environments. USERPRINCIPALNAME() always returns the UPN format regardless of environment, which is why most consultants default to it for consistency.

For data-driven dynamic RLS, the pattern that scales best is an authoritative AppUser mapping table, storing each person’s UPN alongside their assigned territory or role, joined to your dimension tables through relationships. A pragmatic approach treats that AppUser table as the single source of truth, maintained from HR or identity provisioning flows rather than edited manually inside Power BI Desktop.

Pro Tip: If you’re embedding reports for external customers, be careful with CUSTOMDATA(). The application is trusted to pass the correct identity, so any flaw in your embedding code becomes a data leak, not just a bug.

Example: filter sales data by region and validate locally

A worked example beats an abstract one. Picture a simple sales model: a Region dimension table, a State table beneath it, and a Sales fact table connected through standard relationships flowing from Region down to the transaction grain.

  1. Static filter for a fixed audience. On the Region table, a role called “WestOnly” carries the rule [Region] = "West". Anyone assigned to this role sees only West region transactions, because the filter propagates from Region through State down to Sales via the model’s relationships.
  2. Dynamic filter for a growing team. On an AppUser mapping table joined to Region, a role called “TerritoryManagers” carries [UPN] = USERPRINCIPALNAME(). Each manager sees only the rows tied to their own UPN entry in the mapping table, and adding a new manager means adding a row, not a new role.
  3. Test both roles in Desktop. Under Modeling, click View as, select the role, and optionally supply another user’s UPN to simulate their exact view. This is where you catch a filter that isn’t propagating correctly, long before a real user does.

Testing locally in Desktop before publishing catches a significant portion of RLS design mistakes, because you can iterate on the DAX and immediately see the filtered result set without touching the published dataset.

Publish, map members and validate in the Power BI service

Publishing moves your roles from design-time definitions into a live security boundary, but the roles themselves do nothing until you assign real people to them.

After publishing the PBIX file, open the dataset settings in the Power BI service and confirm the roles you built in Desktop appear under Security. From there:

  • Assign Microsoft Entra security groups rather than individual users wherever possible. Groups are easier to maintain as staff join or leave, and they integrate cleanly with your existing identity provisioning.
  • Use Test as role in the service to simulate exactly what a given role sees, the service-side equivalent of View as in Desktop.
  • Check UPN formats carefully when testing. Guest users (B2B) sometimes authenticate with a different UPN format than internal employees, and a mismatch here silently breaks the filter rather than throwing an error.
  • Watch permission levels closely. RLS enforcement depends on the consumer’s permission level; anyone with Member, Contributor, or Admin access to the workspace can bypass row-level security entirely, because those roles carry edit rights that supersede the Viewer-level restriction RLS is built around.

That last point is the one organisations get wrong most often. Teams design meticulous dynamic RLS, test it thoroughly, then hand out Contributor access to half the business because it’s convenient, quietly nullifying every rule they built.

RLS and external enforcement: DirectQuery, Analysis Services, SSO and EffectiveUserName

Not every RLS scenario is enforced inside Power BI itself. Once you connect live to Analysis Services or a DirectQuery source with single sign-on, the enforcement boundary can shift entirely to the source system.

  • Live connections to Analysis Services require RLS to be defined in the Tabular model itself, not in Power BI, because Power BI is simply a client querying that model.
  • EffectiveUserName carries the identity. Power BI uses EffectiveUserName to impersonate the requesting user against on-premises or Azure Analysis Services, meaning the model, not the report, decides what that user sees.
  • DirectQuery with SSO shifts enforcement to the database. When a DirectQuery source supports single sign-on, Power BI passes the user’s own credentials through, and the database applies whatever row-level security it has configured, independent of anything defined in Power BI.
  • Calculated tables and columns referencing SSO-enabled DirectQuery sources aren’t supported in the service, a limitation that catches modellers who build convenience columns on top of a live SSO connection and then wonder why publishing fails.

The practical implication: if your architecture leans on DirectQuery against a database with its own security model, your RLS strategy conversation needs to happen with the DBA team, not just the Power BI author. Integrated authentication can also cause RLS to be bypassed entirely if the service account used for the connection has broader access than intended, so credential scoping deserves as much scrutiny as the DAX rules themselves.

Performance and common pitfalls: model design, LOOKUPVALUE and testing impact

RLS adds a filtering step to every query, and how you write that filter determines whether it’s imperceptible or painfully slow.

  1. Apply filters to dimension tables, not fact tables. Filtering directly on a large fact table is a common performance pitfall; instead, put the rule on a small dimension table like Region or Customer and let the model’s relationships propagate that filter down to the fact table automatically.
  2. Avoid LOOKUPVALUE and other expensive functions inside RLS rules when a relationship-based filter would achieve the same result. LOOKUPVALUE scans without the benefit of the relationship engine’s optimisations, and inside a security rule evaluated on every query, that cost compounds fast.
  3. Measure before and after with Performance Analyzer. Testing RLS performance in Desktop before publishing quantifies exactly how much query time your filters add, turning a vague worry into a concrete number you can optimise against.
  4. Work through a troubleshooting checklist when results look wrong. Check whether relationships are active and flowing in the expected direction, whether a bi-directional relationship is causing unexpected filter propagation, whether a user has been assigned to multiple roles with conflicting rules, and whether an empty mapping table is silently returning zero rows for everyone.

Pro Tip: A user assigned to two roles doesn’t get the stricter of the two applied. Power BI unions the results, so if one role says “West only” and another says “Everything”, that user sees everything. Audit role assignments as carefully as you audit the DAX.

Good data modelling practice resolves most of this before it becomes a problem: a clean star schema with filters sitting on dimension tables keeps both your RLS logic and your query performance predictable.

When to avoid RLS and practical alternatives

RLS is not always the right tool. For a handful of fixed, non-overlapping audiences, it can be simpler and faster to skip dynamic security altogether.

  • Separate semantic models and workspaces can outperform complex RLS when you only have two or three distinct, static audiences, since Microsoft’s own guidance acknowledges that simpler publishing patterns sometimes beat elaborate rule sets.
  • Duplication has its own costs. Running separate models means separate refresh schedules, separate permission sets to manage, and the risk that a change to business logic gets applied to one model but forgotten in another.
  • Choose based on scale and volatility, not preference. Two or three audiences with rules that rarely change favour separate semantic models. Dozens of users whose access shifts as territories or org charts change favour dynamic RLS with a mapping table.

The trade-off is refresh complexity against rule complexity. Pick whichever complexity your team is actually equipped to maintain over the next two years, not just at launch.

Defence-in-depth: how RLS fits with sensitivity labels, DLP and session monitoring

RLS filters rows, but it does nothing to stop someone from exporting a filtered dataset to Excel and forwarding it to someone outside their role. That’s where complementary controls come in.

  • Sensitivity labels from Microsoft Purview travel with exported files, applying encryption and usage restrictions even after data leaves the Power BI environment.
  • Microsoft Defender for Cloud Apps monitors sessions and can flag unusual download volumes or access patterns that suggest someone is probing the edges of their RLS-restricted view.
  • Governance discipline matters as much as technical controls. Assigning security groups instead of individual users, restricting who holds workspace Contributor or Admin roles, and periodically auditing role assignments closes the gaps that RLS alone leaves open.

Microsoft’s own security guidance frames this explicitly: RLS works best as one layer in a defence-in-depth approach, not as the sole security boundary protecting your data. Treating it as the only control is the mistake that turns a well-designed rule set into a false sense of safety. Strong Power BI governance practices, reviewed on a regular cadence, are what actually keep that layered approach intact over time.

Practitioner checklist for governing RLS at scale

Consulting engagements tend to reveal the same pattern: RLS design is rarely the hard part, maintaining it over eighteen months is.

A workable project sequence looks like this: design the roles around real organisational boundaries first, build an authoritative AppUser mapping table before writing a single DAX rule, implement the roles in Desktop, test with automated checks rather than manual spot-checks alone, then monitor role assignments on an ongoing basis rather than treating go-live as the finish line.

The pitfalls that recur across organisations are strikingly consistent. Teams assign individual users to roles instead of groups, then spend months manually updating membership as staff move between departments. Teams let the AppUser table drift out of sync with HR records because nobody owns updating it. And teams skip automated role testing entirely, relying on a single manual check at launch that never gets repeated as the model evolves.

The mitigation for all three is the same: make group-based assignment the default, keep one mapping table as the single source of truth, and build role testing into whatever release process governs changes to the semantic model.

Why governance discipline matters more than clever DAX

The technical side of RLS gets most of the attention, and honestly, it’s the easier half. Writing a dynamic rule with USERPRINCIPALNAME() and a mapping table is a solved problem; Microsoft’s documentation covers it thoroughly, and most competent Power BI developers get it right on the first or second attempt.

Where I see organisations actually struggle is governance discipline after the fact. Nobody owns the AppUser table six months post-launch. Workspace Contributor access creeps outward because it’s easier than filing an access request. Nobody re-tests roles after a model refactor changes a relationship direction.

Why governance discipline matters more than clever DAX — overview diagram

Conventional advice treats RLS as a one-time implementation task: build it, test it, ship it. That framing undersells the reality. RLS is a living control that needs the same change management discipline as any other security boundary, reviewed whenever the model changes, whenever staff turn over, and whenever workspace permissions get touched.

If you take one thing from this, prioritise the permissions caveat above the DAX cleverness. A perfectly written dynamic rule protects nothing if half your organisation has Contributor access to the workspace. Fix the permission model first, then worry about the elegance of your filter expressions.

— Michael

Get help implementing RLS without the trial and error

Organisations seeking RLS designed correctly the first time, rather than discovered through a permissions incident six months into production, may consider engaging expert consultancy. Getting the AppUser mapping table right, choosing between static and dynamic patterns, and setting up automated role testing takes real Power BI and Microsoft Fabric expertise, and getting it wrong quietly undermines every other security control you’ve put in place.

Datataal

Services can include security audits of existing semantic models, design workshops to map roles against organisational structure, proofs of concept for dynamic RLS, and managed implementations for organisations preferring external expertise. Engaging a consultant makes the most sense when you’re migrating complex security from an old model, scaling a mapping table across departments, or building automated testing into your deployment pipeline for the first time.

If your organisation is planning a Power BI or Microsoft Fabric implementation and needs security built in from day one rather than retrofitted later, get in touch through Datataal to discuss a scoped audit or workshop.

Sources

For the authoritative detail behind everything covered here, Microsoft Learn’s row-level security guidance for Power BI covers the full implementation workflow, while the RLS guidance in Power BI Desktop goes deeper on performance and design trade-offs. The security overview from Microsoft sets RLS within the broader defence-in-depth picture.

On the Datataal side, the guides on Power BI governance and performance tuning extend several points raised above, and row-level security: a practical guide offers a useful complementary, non-Microsoft perspective.

FAQ

What is RLS in Power BI?

Row-level security (RLS) is a feature that filters the data rows a user can see within a report or semantic model, based on rules tied to their identity, rather than restricting which pages or visuals they can view.

What does RLS stand for in Power BI?

RLS stands for row-level security, the mechanism that controls data access at the row level of a table rather than at the object or report level.

What are the differences between RLS and OLS in Power BI?

RLS filters which rows of data a user can see, while object-level security (OLS) hides entire tables, columns, or measures from a user regardless of the row-level filters applied.

How do I check whether RLS is working in Power BI?

Use View as role in Power BI Desktop to simulate a role locally, then use Test as role in the Power BI service after publishing to confirm the correct filters apply once real Microsoft Entra users or groups are assigned.

Can RLS be bypassed in Power BI?

Yes. Anyone with Member, Contributor, or Admin permission on the workspace can bypass RLS entirely, because those permission levels carry edit rights that override the Viewer-level restriction RLS depends on.

Microsoft Fabric blog