Power BI row-level security (RLS) filters the rows of a semantic model so each person sees only the data they are allowed to see. You define roles with DAX filters in Power BI Desktop, then assign people or groups to those roles in the Power BI service. RLS applies to workspace Viewers. Admins, Members and Contributors see every row.
That last point catches many teams out. This guide covers static and dynamic RLS with a worked example for a Canadian sales team, then testing, apps, Direct Lake and OneLake security. Everything here is checked against Microsoft's row-level security documentation as of November 2026. If you are still building out the rest of your reporting, our Power BI best practices guide is a good companion.
What Is Row-Level Security in Power BI?
RLS is a filter that Power BI adds to every query a user runs against a semantic model. Each role holds one or more DAX expressions that return true or false for every row of a table. Rows that return true stay visible. Everything else is removed before any visual or Analyze in Excel session can use it.
A common case: one sales report serves the whole country, and the Ontario manager should see Ontario sales only. With RLS you publish one report and one semantic model, and the filter follows each person.
RLS secures rows. It does not hide tables or columns. If a user can see a row, they can see every column in it. Hiding a salary column or a whole table is the job of object-level security, covered further down.
Static vs Dynamic RLS
There are two ways to write the filter. The difference is whether you hard-code the value or look it up from the signed-in user.
| Static RLS | Dynamic RLS | |
| What the filter looks like | [Region] = "Ontario" | Matches USERPRINCIPALNAME() to a mapping table |
| Roles you maintain | One per audience | Usually one for everyone |
| Who changes access | A model author edits roles or role members | Whoever maintains the mapping table |
| Best fit | A handful of fixed audiences | Many users, or access that changes often |
| Main risk | Role sprawl as audiences grow | A missing or mistyped email shows the user nothing |
Static RLS suits two or three audiences that rarely change. Once you have dozens of managers or branches, dynamic RLS is easier to run.
What Is Dynamic Row Level Security in Power BI?
Dynamic row-level security is a single role whose filter reads who is viewing the report and looks up what they may see. The DAX function USERPRINCIPALNAME() returns the user's sign-in name, which usually looks like an email address, and the filter compares it with a mapping table.
One quirk: in Power BI Desktop, USERNAME() returns DOMAIN\user, while USERPRINCIPALNAME() returns user@company.com. In the Power BI service both return the user principal name. Use USERPRINCIPALNAME() so Desktop testing and the service behave the same way.
A Worked Dynamic RLS Example
Say a distributor sells across four Canadian regions and reports on one Sales table. Each regional manager should see their own region. One manager covers two regions. The VP of Sales sees everything.
Step 1: build a mapping table. Create a small table called UserRegion, loaded from a SharePoint list, a database table or a sheet that HR or sales operations owns.
| UserEmail | Region |
| amira@yourcompany.ca | Ontario |
| luc@yourcompany.ca | Quebec |
| jordan@yourcompany.ca | Prairies |
| jordan@yourcompany.ca | British Columbia |
Step 2: filter the Region dimension. Put the filter on the Region table, which already has a one-to-many relationship to Sales. The filter flows from Region to Sales through that relationship. Microsoft's RLS guidance recommends filtering dimension tables over fact tables because it is usually faster. In a role called Regional Manager, add this DAX filter to the Region table:
VAR CurrentUser = USERPRINCIPALNAME()
RETURN
[Region]
IN CALCULATETABLE (
VALUES ( UserRegion[Region] ),
UserRegion[UserEmail] = CurrentUser
)
UserRegion stays disconnected from the model, so no bidirectional relationship is needed. Jordan's two rows give him both regions.
Step 3: protect the mapping table. Add a second filter in the same role, on UserRegion itself: [UserEmail] = USERPRINCIPALNAME(). Hide the table too, so nobody can build a visual that lists who sees what.
Step 4: add a role for full access. Create a role called National with the filter TRUE() on the Region table, and put the VP in it. Roles are additive, so a user in both roles sees the union of the two.
The result:
| Person | Role | Regions they see |
| Amira | Regional Manager | Ontario |
| Jordan | Regional Manager | Prairies, British Columbia |
| VP of Sales | National | All four |
| A new hire not in UserRegion | Regional Manager | None |
| Any workspace Contributor | None needed | All four, because RLS does not apply |
How to Set Up RLS in Power BI Desktop and the Service
The workflow is the same for static and dynamic roles.
- In Power BI Desktop, open the Modeling tab and select Manage roles.
- Select New, name the role, and choose the table to filter.
- Write the filter. Simple static rules work in the default editor. Dynamic rules with USERPRINCIPALNAME() need the DAX editor, which you open with Switch to DAX editor.
- Save, then test the role with View as on the Modeling tab.
- Publish the report and semantic model to a workspace.
- In the service, open the More options menu on the semantic model and select Security.
- Add members to each role. You can add individual users, Microsoft Entra security groups, distribution groups and mail-enabled groups. Microsoft 365 groups are not supported.
- Use Test as role from the role's More options menu to check the published model.
You cannot assign members in Desktop. Microsoft recommends security groups over individual users, so membership is managed in Microsoft Entra ID.
How to Test RLS Before Anyone Sees the Report
- View as (Desktop) applies one or more roles to every visual. Use it while you build.
- Test as role (service) does the same for the published model and lets you switch to a specific person through Now viewing as.
- Test as role does not work for DirectQuery models with single sign-on enabled, or for paginated reports.
Microsoft's guidance suggests a measure that returns the user name on a card in a test report. When someone sees nothing, compare that value with the mapping table.
Who RLS Does Not Apply To
RLS only applies to people who have Read permission on the semantic model. Microsoft states that workspace Admins, Members and Contributors have edit rights on the model, so RLS does not filter what they see. Anyone with Write permission on the model bypasses it too.
| How someone gets access | Does RLS apply? |
| Workspace Viewer | Yes |
| Workspace Viewer with Build permission (Analyze in Excel, new reports) | Yes |
| Workspace Admin, Member or Contributor | No |
| Report shared directly, with Read on the model | Yes |
| App audience member, with Read on the model | Yes |
| Embedded report using a service principal | Only if the app passes an effective identity |
Report consumers belong in an app or the Viewer role, never in Contributor. A manager who also builds reports can be a Viewer with Build permission. Our Power BI pricing and licensing guide covers what each viewer needs to be licensed for.
RLS With DirectQuery, Direct Lake and OneLake Security
Import and DirectQuery. Power BI RLS works with both. Microsoft notes that with DirectQuery the source database can also apply its own security, because each query goes back to the source. For a live connection to Analysis Services, RLS is defined in the Analysis Services model, not in Power BI.
Direct Lake. Semantic model RLS works on Direct Lake models in Microsoft Fabric. Per Microsoft's Direct Lake security documentation, if a model reads through a SQL analytics endpoint whose table has its own RLS, queries fall back to slower DirectQuery.
OneLake security. Fabric can also enforce row and column rules in OneLake itself, and those rules apply to every engine that reads the data. Rules in a semantic model apply only inside that model. If your viewers can also query the lakehouse directly, model RLS will not stop them, so Microsoft recommends OneLake security for rules that must hold everywhere. Our guide to what OneLake is explains how that storage layer works.
RLS vs Object-Level Security
Object-level security (OLS) hides whole tables or columns from a role. To a user without access, the secured object behaves as if it does not exist, and any visual that uses it shows an error that the field cannot be found. You define OLS in the same roles as RLS, through TMDL view in Desktop or an external tool such as Tabular Editor. Like RLS, OLS only applies to Viewers.
Use RLS for different rows of the same columns, such as each region's sales. Use OLS when some people should not see a column at all, such as salary or cost price.
Common RLS Mistakes Checklist
Run through this before you share a report that uses RLS.
- Report consumers sit in the Viewer role or an app, and none of them are Contributors.
- Every person who needs access appears in the mapping table, with the exact value USERPRINCIPALNAME() returns for them.
- The mapping table is hidden and filtered so users cannot read it.
- Filters sit on dimension tables and reach fact tables through active relationships.
- No user is in two roles that conflict, because roles add together.
- Security groups are used for role membership, and no Microsoft 365 groups are in roles.
- Each role was tested with View as and Test as role, and dynamic rules were checked with a real account.
- Nobody plans to use Publish to web, which does not work with RLS.
Frequently Asked Questions
What is dynamic row level security in Power BI? Dynamic RLS uses one role whose DAX filter checks the signed-in user with USERPRINCIPALNAME() against a mapping table. Each user sees only the rows the table assigns to them. Adding someone means adding a row to the table, with no change to the roles.
Should I use row level security? Use it when one report serves many people who should see different slices of the same data, such as regions, branches or client accounts. Microsoft's guidance suggests skipping RLS when you have only a couple of fixed audiences, because separate semantic models can be simpler and faster.
What is RLS and CLS? RLS restricts which rows a user can see. CLS, column-level security, restricts which columns they can see. In a Power BI semantic model, columns and tables are secured with object-level security. OneLake security and the Fabric SQL analytics endpoint also offer column-level security.
How to remove row level security from Power BI report? Roles live in the semantic model, so remove them there. Open Manage roles in Power BI Desktop, delete the role or its filters, and publish again. To give one person full access without removing RLS, add them to a role whose filter is TRUE().
Does RLS work with Direct Lake? Yes. Semantic model RLS applies to Direct Lake models. Queries can fall back to DirectQuery when the SQL analytics endpoint also enforces RLS on a table.
Why does a user see no data? Usually their sign-in name is missing from the mapping table, stored in a different format, or they are in no role.
Row-level security was part of our public sector work for the City of Peterborough, alongside role-based access control, aligned with municipal data governance standards.
Need RLS designed into a model that serves the whole organization? Talk to Alphabyte and choose Reporting & Analytics, or see our Power BI consulting and reporting and analytics pages.