Power BI RLS vs OLS: Securing Rows, Tables and Columns
See how Power BI RLS filters rows while OLS hides tables and columns, which workspace roles bypass both, and how to test each identity before you publish.
By jackey.ye | Updated: 2026-11-26
Row-level security (RLS) filters which rows a role can read; object-level security (OLS) hides entire tables or columns, including their names, from a role. Both live in semantic model roles and bind every Viewer-role identity that reaches the model — workspace Viewers, app consumers and anyone with only read or build access — while Admin, Member and Contributor bypass them. Report and app consumers are covered too, not just explicit workspace members.
For data engineers and analytics architects, the harder part is authoring and verifying. This tutorial walks through choosing between RLS and OLS, writing a filter that fails closed, testing each identity, and protecting sensitive columns without breaking reports.
RLS vs OLS: What Is the Actual Difference?
RLS answers "which rows of this table can this role see?" OLS answers "can this role see this table or column at all?" Microsoft defines RLS as filters applied automatically to every DAX query for members of a role, where each row is evaluated TRUE or FALSE and only TRUE rows are visible (Row-level security with Power BI). OLS sets a metadataPermission of None or Read on a table or column; for a role without permission, "it's as if the secured tables or columns don't exist," and the restriction covers object names and metadata, not only the data (Object-level security in Fabric). Both are defined inside model roles, so a single role can carry a row filter and an object restriction at once.
The practical consequence: RLS never hides a column. Microsoft's own RLS FAQ states that a user with access to a row sees all columns of that row, and points to OLS for restricting columns and column metadata. A Viewer under an RLS role can still see a Salary or NRIC column in the field list and aggregate it unless a row filter happens to exclude every row. OLS is the control that removes the column from the model's surface for that role.
Which Workspace Roles Bypass RLS and OLS?
Only the Viewer workspace role is constrained; Admin, Member, and Contributor bypass both controls. Microsoft states that workspace members assigned Admin, Member, or Contributor have edit permission for the semantic model, and therefore RLS doesn't apply to them (RLS with Power BI). The OLS page repeats the rule: OLS "only applies to Viewers in a workspace" (OLS in Fabric). This is the most common cause of a "security leak" that is not a bug.
Workspace role versus whether model security applies. Only the Viewer role is constrained by RLS and OLS; Admin, Member and Contributor hold edit permission on the semantic model and bypass both. Source: Microsoft Learn, Roles in workspaces in Power BI and RLS/OLS documentation.
Two nuances decide the workspace design. First, Build does not bypass semantic model security. Microsoft's RLS page is explicit that even Viewers given Build "their view of the data is restricted by RLS," and the semantic model permissions page confirms that Read or Build users can't read data from a model with RLS unless they belong to an RLS role. What Build changes is visibility, not filtering: it "allows user to see hidden data fields" and querying through external APIs such as XMLA (Semantic model permissions). Hidden fields are not security, either — Microsoft notes that hiding a table or column "isn't a security measure," only a clutter-free UX option (Sharing reports in Power BI). So a Salary column merely toggled hidden stays readable; OLS is what removes it. Second, Write permission does bypass RLS: "Users with write permission on the semantic model can read data from the semantic model regardless of whether or not they belong to any of its RLS roles." If your consumer group holds Write, RLS is decorative.
The design rule that follows: distribute to consumers through an app or direct sharing to Viewers, and keep anyone who must be filtered out of Contributor and above. Microsoft lists publishing an app as a supported way to enforce RLS without giving workspace access (Roles in workspaces).
How Do You Decide Between RLS, OLS, or Both?
Pick RLS when a role must see fewer rows of the same shape of data; pick OLS when a role must not know a table or column exists; put both in the same role when a role needs both. The table below maps each requirement to the control that satisfies it.
Dimension | Row-level security (RLS) | Object-level security (OLS) |
|---|---|---|
What it restricts | Rows returned by a DAX filter expression for the role | Entire tables or columns; the object behaves as if it does not exist |
Hides metadata (names) | No — column and table names remain visible | Yes — object names and metadata are restricted |
Applies to workspace roles | Viewer only; Admin, Member, Contributor bypass | Viewer only; Admin, Member, Contributor bypass |
Where authored | Power BI Desktop role editor (DAX view for dynamic rules), or TMDL/TMSL/TOM | TMDL view or external tools such as Tabular Editor; TMSL/TOM for tabular models |
Effect of Build permission | Viewer with Build is still filtered, but sees hidden fields and model metadata via XMLA/REST | Applied; Build exposes model metadata, so tag the schema itself as sensitive |
Typical use | Region, tenant, or business-unit scoping of fact rows | Salary, NRIC/national ID, PII, or financial columns that must not be discoverable |
Documented limitations | Filters apply to every DAX query and can affect performance; not a column-hiding control | Cannot break a relationship chain; RLS and OLS from different roles cannot be combined; unsupported by Q&A, Quick insights, Smart narrative, Excel Data Types gallery |
If both requirements are true — a regional manager who also must not see the Base Rate column — put the row filter and the object restriction in the same role. Microsoft documents that RLS and OLS cannot be combined from different roles because it could introduce unintended access to secured data, and an error is generated at query time for users who are members of such a combination (OLS restrictions).
One authoring difference to plan for: the Desktop role dialog creates row filters, but OLS is defined through TMDL view or an external tool. Microsoft's Fabric OLS page walks through a createOrReplace TMDL script that sets metadataPermission: none on a table or column, with Preview before Apply (OLS in Fabric).
Prerequisites Before You Configure Either Control
Confirm each item before you touch a role definition:
A published semantic model in a workspace where you can assign roles. RLS roles are applied to members assigned the Viewer role in that workspace (RLS with Power BI).
A test identity you control — a second Entra ID account or a security group whose membership you can change. Do not test with your own admin account; it bypasses both controls.
The model's connection mode, because it changes where security is enforced. Imported models use model-defined RLS. For Analysis Services or Azure Analysis Services live connections, you configure RLS in the model, not in Power BI, and the security option doesn't show up in the service.
The data connection's identity setting, because DirectQuery does not automatically hand the end user's credentials to the source. Only when the source supports SSO and SSO is enabled on the connection does Power BI pass the signed-in identity through; otherwise the query runs under the stored connection credentials for all viewers. Direct Lake behaves the same way with a fixed identity versus SSO.
A decision on Build permission for consumers, since Build lets a Viewer see hidden fields and query via XMLA.
A named owner and review date for the role definitions, so a model change triggers a re-test.
If your model uses Direct Lake, read the connection-mode caveat in the limitations section below before assuming either control behaves as it does on an imported model.
Step-by-Step: Configure and Test RLS and OLS
Work through these in order. Each step ends with a checkpoint you can verify before moving on.
Inventory the sensitive objects and the row-scoping requirement. List every table and column that must be hidden (for example
Employee[Base Rate],Customer[NRIC]) and every fact table that needs row scoping (for exampleSales[Region]). Checkpoint: the list names the object, the role that must lose access, and the business reason.Create the role, then switch the editor to DAX. On the Modeling tab, open Manage roles, choose New, name the role, and select the table to filter. Dynamic rules such as
USERNAME()andUSERPRINCIPALNAME()can't be built in the drop-down editor, so select Switch to DAX editor before you type (RLS with Power BI). Checkpoint: the expression box is in DAX mode and validates with the checkmark.Write a filter that fails closed for unmapped identities. The role below is defined on the
Salesfact table and usesLOOKUPVALUEto search theUserRegionmapping table directly for the signed-in UPN — no relationship betweenSalesandUserRegionis required for the expression to work. A blank or unknown UPN falls through toFALSE(), so it sees nothing instead of everything:// Role: RegionManager — filter expression on the Sales table VAR CurrentUser = USERPRINCIPALNAME() VAR CurrentRegion = LOOKUPVALUE ( UserRegion[Region], UserRegion[UserPrincipalName], CurrentUser ) RETURN NOT ISBLANK ( CurrentRegion ) && Sales[Region] = CurrentRegionWithin the Power BI service,
USERNAME()andUSERPRINCIPALNAME()both return the user's UPN. TheNOT ISBLANK()guard is the part that matters: it stops an unmapped user from matching rows whose region is blank, because a blank lookup result can coerce and compare equal to those rows instead of excluding them. Microsoft's RLS guidance still prefers enforcing filters on a dimension table and letting relationships propagate them, and warns againstLOOKUPVALUEwhen a model relationship achieves the same result (RLS guidance) — that relationship-based design is the preferred alternative, not a prerequisite of the expression above. Checkpoint:Sales[Region]andUserRegion[Region]hold the same region values, and the column names match your model exactly.Add OLS to the same role through TMDL. OLS lives in the role definition, so it's edited in TMDL view or an external tool rather than the Desktop drop-down dialog. Work through these in order:
Open the model's TMDL view and create a new script tab.
Start the script with
createOrReplaceand name the role that should lose access — the existing role you already built the row filter in.Keep the role-level permission the role already has (Microsoft's sample uses
modelPermission: read).createOrReplacerewrites the named role, so dropping lines you didn't intend to change is how you accidentally widen or break a role.Add
tablePermissionfollowed by the table name; the table name is on the same line as the keyword, not indented beneath it. To secure a whole table, go straight to the next item.For a column, add
columnPermissionand the column name on the same line, nested under thetablePermissionyou just wrote. Skip this line to secure the entire table.Close with
metadataPermission: none—noneenforces OLS and hides the object from the role, whilereadleaves it visible.Select Preview and confirm the diff touches only the intended object, then Apply. Microsoft's Fabric OLS page documents this authoring flow and the
metadataPermissionvalues (OLS in Fabric).Publish the model and assign members to the role on its Security page.
Because the layout matters as much as the keywords, treat the TMDL tab's own formatting preview as the source of truth rather than copying a snippet from a blog post. Checkpoint: the preview diff names one role, one table, and one
metadataPermissionchange; nothing else in the role moved tonone.Publish the semantic model to the workspace. Checkpoint: the publish succeeds and the model appears in the workspace item list.
Assign Viewers and role members in the service. Open the semantic model's More options (...) menu, select Security, and add users or groups to the role. Assign consumers the Viewer workspace role, not Contributor or above. Checkpoint: every consumer appears as a Viewer and as a member of exactly one intended role.
Test with View As in Desktop, then with a real second identity in the service. In Desktop, use View as on the Modeling ribbon to render the report under the role. Then sign in as your test account in the service. Skip View As for DirectQuery models that use SSO — Microsoft states the feature doesn't work there, so sign in as a real Viewer instead. Checkpoint: the test account sees only its region's rows and cannot find the secured column in the field list.
Verify with a Who Am I measure and a denied-column check. Add a measure that returns
USERNAME()on a card visual, which Microsoft's RLS guidance suggests naming "Who Am I" for testing purposes (RLS guidance). Checkpoint: the card shows the test account's UPN, the row count matches the expected region, and any visual referencing the secured column returns the "field can't be found" message that OLS produces.Record the role definitions and set a review trigger. Store the DAX filter, the exported role definition, the role membership list, and the test evidence in source control alongside the model. Checkpoint: the record names an owner and a review date, and the review is triggered by any model change that adds a table, column, or relationship.
What Does Testing a Role Identity Actually Prove?
View As in Desktop proves that the role's DAX filter and OLS definition behave as authored. It does not prove that the right people are in the role in the service, and it does not exercise the real UPN path if you are impersonating a user. A real second identity signed in to the service proves role membership and the USERPRINCIPALNAME() mapping.
Build holders are still filtered, so an RLS test on a Build account should return that user's rows, not all rows. What Build does change is exposure: hidden fields and model metadata become readable through XMLA and REST, which is why a hidden column is not a substitute for OLS. Write holders are a different story — they read everything regardless of role, so test them separately or remove the permission.
Report and app consumers are not exempt. Anyone with only read or build permission on the model can't read data from a model with RLS unless they belong to an RLS role, and Microsoft's sharing guidance treats the semantic model, not the report layout, as the place where access is decided. That is why a one-off "share this report" link is not a security measure.
For embedded scenarios, Microsoft warns that when using embed for your customers, app logic can pass any value as an effective identity user name, and recommends that accidental or malicious values result in filters that return no rows (RLS guidance). Microsoft's own example of the failure mode is a rule that returns all rows for an unexpected value like Wrker; the fix is an expression that returns FALSE() for anything it doesn't recognise, which is the shape of the role definition in step 3.
What Are the Documented Limitations Across Connection Modes?
The control you configure depends on where the model gets its data, and the behavior differs by mode.
Imported models. RLS is defined in the model and enforced by Power BI. Source security roles are not used (RLS with Power BI).
DirectQuery. Model RLS still applies, and the source adds its own layer — but only if it receives an identity. Per Microsoft's DirectQuery documentation, "unless SSO is configured, DirectQuery uses configured stored credentials for all viewers," so every consumer queries the source as the same account and source-side RLS sees one user. When the connector supports SSO and SSO is enabled on the connection, Power BI passes the report consumer's identity and the source enforces its own rules. Check which case you're in before you rely on source security.
Live connections to Analysis Services or Azure Analysis Services. Configure RLS in the model, not in Power BI; the security option doesn't show up for live-connection semantic models.
Direct Lake on SQL analytics endpoints. Microsoft states that Direct Lake doesn't support SQL analytics endpoint OLS/RLS in memory. A query touching a table or column restricted by SQL endpoint OLS or column-level security returns an error; a query referencing a table that enforces RLS, or a view, falls back to DirectQuery mode, and fails if fallback is disabled (Direct Lake security integration).
Direct Lake on OneLake. The same page states this path avoids those specific limitations, and that OneLake security rules are applied first, then semantic model rules — the model layer is not skipped, it runs second. OneLake's own OLS only applies to workspace Viewers; it doesn't stop Contributors or higher from discovering secured tables or columns because they already hold Write permission on all workspace items. Separately, Viewers with Build or higher can read model metadata through XMLA and REST, which tells them a secured table or column exists "but they can see that the secured tables and columns exist" without necessarily having data access.
That split matters. Metadata disclosure is a visibility gap in the OneLake and model-permission layers, not a bypass of semantic-model OLS: the column is still filtered or hidden for Viewers at query time. It is the reason to avoid blanket claims that "Direct Lake handles OLS." It depends on whether the model is bound to the SQL analytics endpoint or to OneLake, and on what Build or Write the viewer holds. For the broader choice between Direct Lake, Import, and DirectQuery, see the connection-mode comparison for Power BI semantic models.
OLS also has feature-level limits independent of connection mode: models with OLS configured are not supported with Q&A visualizations, Quick insights, Smart narrative, or the Excel Data Types gallery (OLS in Fabric). Table-level OLS cannot break a relationship chain — if A relates to B and B to C, you cannot secure B without an error at design time (OLS restrictions).
How Should You Handle Sensitive Columns Beyond OLS?
OLS is one layer. Microsoft's sensitivity-label documentation notes that users granted access to a report are granted access to the entire underlying semantic model unless RLS limits their access, and that labels with protection settings apply when data leaves Power BI through supported export paths such as Excel, PowerPoint, PDF, .pbix download, and Save in Desktop (Sensitivity labels in Power BI).
A workable layering for a sensitive column such as Employee[Base Rate]:
OLS removes the column from the model surface for the Viewer role. Toggling the column hidden does not — hidden fields stay readable for anyone with Build or higher.
A sensitivity label with protection settings governs the export path, so a permitted export remains protected.
Least-privilege source access means the semantic model is not the only thing standing between a user and the raw table. If consumers can query the lakehouse or warehouse directly — which SSO on a DirectQuery connection makes possible — model OLS is irrelevant to them at that path.
That third layer is the same principle behind read-only, least-privilege SQL access for downstream tools: scope the role, remove write and DDL paths, and validate that identity propagation actually took effect. The read-only SQL least-privilege checklist for lakehouse consumers covers that pattern in detail.
For teams operating across Singapore (SGT, UTC+8) and the United States (ET, UTC−5/UTC−4; PT, UTC−8/UTC−7), schedule role-membership reviews and refresh-dependent re-tests in a window both regions can act on, and record the time zone in the review record so a "next business day" instruction is unambiguous.
Reusable Asset: RLS/OLS Testing Checklist
Copy this into your runbook and complete it for every role change.
Role definition reviewed: DAX filter references correct columns; OLS
metadataPermissionset on the intended table or column only.RLS and OLS for the same audience live in the same role, not split across roles.
Role membership list exported and stored with the model definition.
Every consumer holds the Viewer workspace role; no consumer holds Contributor, Member, or Admin.
Build and Write holders audited: confirm each is intentional and documented.
View As test passed in Desktop for each role.
Real second-identity test passed in the service for each role.
Who Am I measure returns the expected UPN for the test account.
Row counts match the expected scope for the test account.
Secured column returns the "field can't be found" message for the test account.
Unmapped UPN returns no rows, not all rows.
Export path tested: a permitted export carries the sensitivity label and protection settings.
Direct source access checked: consumers cannot query the lakehouse or warehouse outside the model.
Review trigger recorded: any new table, column, or relationship reopens this checklist.
Example configuration — validate in your target environment.
Frequently Asked Questions
Does RLS hide a sensitive column from report viewers?
No. RLS filters rows; it does not remove a column from the model. A Viewer under an RLS role can still see the column in the field list and aggregate it unless the row filter excludes every row. Use OLS to hide the column itself.
Can a workspace Contributor see data that RLS is supposed to restrict?
Yes. Microsoft states that Admin, Member, and Contributor roles have edit permission on the semantic model, so RLS and OLS do not apply to them. Only the Viewer role is filtered — including Viewers with Build, whose data view stays restricted even though hidden fields and model metadata become visible. Keep consumers in Viewer and distribute through an app.
Does OLS work in Direct Lake models?
It depends on the binding. Direct Lake on SQL analytics endpoints does not support SQL endpoint OLS/RLS in memory; restricted objects return an error and RLS or views trigger DirectQuery fallback. Direct Lake on OneLake avoids those specific limitations and applies OneLake security rules first, then semantic model rules — model OLS still runs, so Build-level metadata discovery is a visibility caveat rather than a bypass.
What happens if RLS and OLS are defined in different roles for the same user?
Microsoft documents that RLS and OLS cannot be combined from different roles because it could introduce unintended access to secured data, and an error is generated at query time for members of that combination. Put both controls in the same role.
Does DirectQuery pass each viewer's credentials to the data source?
Not automatically. Only when the connector supports SSO and SSO is enabled on the connection does Power BI pass the signed-in identity; otherwise the query uses the stored connection credentials for every viewer, so source-side RLS sees a single account. Model RLS still applies on top. View As also doesn't work for DirectQuery models with SSO enabled — sign in as a real Viewer to test.