PREP WITH PROOF
Menu
MICROSOFT FABRIC / PRACTICAL GUIDE

Test Fabric Semantic Model RLS With Two Real Users

Validate Fabric semantic model row-level security with two Viewer accounts, known row IDs, dynamic identity checks, negative tests and role-overlap checks.

THE QUICK ANSWER

A successful RLS test proves both that permitted rows appear and that forbidden rows stay unavailable. Use two real consumer accounts against the same published report, with a small fixture whose row IDs and totals you already know. Check their effective permissions before trusting the result: an author account is a poor stand-in for a restricted consumer. This guide provides a repeatable acceptance procedure for a Power BI semantic model in Fabric, not a claim that a particular tenant has passed it.

Start with the access path, not the slicer

Write down exactly what you are testing: the workspace, semantic model, report, storage mode, and delivery route. A report opened from an app can look identical to one opened from a workspace. Record the semantic model identity as well as the report name so a duplicate report cannot quietly send the test to a different model.

Keep semantic model security separate from permissions on a lakehouse, warehouse, SQL endpoint, or downloadable source file. Passing this report test does not establish that every other route to the underlying data is restricted. Inventory those routes separately. A consumer who can query the original source may have access beyond what this report displays.

Remove ordinary report filters from the acceptance page. A slicer that happens to select East can make an unrestricted report look correct. Give each account the opportunity to clear filters, select other categories, and open the detail page. Treat those actions as attempts to falsify the security claim, rather than a demonstration of the expected screenshot.

Source: Microsoft: Report consumer security planning ↗

Use four orders and two deliberately different totals

Create an isolated test model using synthetic records. Do not copy customer information into a security experiment. The following fixture is intentionally asymmetric: Alice expects two East orders totaling 150; Bob expects two West orders totaling 270. The unrestricted total is 420. These are calculated expectations, not measurements from a deployed Fabric environment.

Create DimRegion with one row per RegionKey, and FactSales with the four records below. Relate DimRegion[RegionKey] to FactSales[RegionKey] using an active one-to-many relationship, with the dimension filtering the fact table. Keep this first model small enough that every visible row can be inspected. Confirm that the dimension keys are unique and the fact keys all match.

Add a table visual with OrderId, RegionKey, and Amount, plus cards for row count and amount. A distinct order count alone can conceal extra detail rows; compare the actual IDs too. Save an unfiltered baseline before defining roles. If the baseline is already wrong, fix the fixture or relationship before debugging authorization.

OrderIdRegionKeyAmount
E-101East100
E-102East50
W-201West200
W-202West70

Establish a simple static-role baseline

In Power BI Desktop, use Modeling, Manage roles to create EastOnly and WestOnly. Put the East expression below on DimRegion for EastOnly; use West for WestOnly. These are alternative role definitions. Do not paste both expressions into the same rule. Publish the test report and its model to the intended workspace, then configure the role memberships in the service.

Assign Alice only to EastOnly and Bob only to WestOnly for this baseline. Role membership does not replace the report access required to open the content. Keep an administrator available to manage the test while both consumer identities remain separate from that administrator. Do not promote a consumer to Contributor merely to make a failed test open.

Check exact row IDs and totals against the fixture. If both users see 420, investigate permissions and whether the report is bound to the correct model before rewriting DAX. If both see 150, inspect role assignments and any saved report filters. Change one cause at a time and preserve the failed observation.

-- EastOnly: table filter on DimRegion
[RegionKey] = "East"

-- WestOnly: separate role, table filter on DimRegion
[RegionKey] = "West"

Source: Microsoft: RLS configuration and service testing ↗

Prove that both accounts are ordinary consumers

Inspect direct workspace assignments and inherited group access. Fabric combines group-derived permissions with other grants, so a direct Viewer assignment is not enough evidence when another group grants Contributor. Record the effective workspace role and semantic model permissions for each account. For this controlled acceptance test, use Viewer accounts without model edit rights.

An account with workspace Admin, Member, or Contributor permissions is unsuitable for proving consumer RLS. Conversely, Build permission alone does not make a Viewer exempt from RLS. If the intended product experience includes Build or Analyze in Excel, include that supported route in the acceptance matrix rather than assuming it behaves like the report UI.

Use separate browser profiles or independent browser sessions, visibly confirm the signed-in account, and open the same report URL. Avoid switching identities in one busy tab and inferring success from its previous screen. Record a timestamp and the account shown in the application for each observation. These operational details make an unexpected result reproducible.

Source: Microsoft: Fabric workspace roles ↗

Then replace the baseline with a small dynamic rule

For a second experiment, add AllowedUPN to DimRegion: alice@example.com on East and bob@example.com on West. Replace these reserved example identities with the actual two test accounts. This deliberately narrow design supports one allowed principal per region; it is not a general solution for many users sharing regions or one user owning several regions.

Create a RegionByIdentity role with the expression below on DimRegion. Add both consumers to that role in the service, and remove their static-role memberships for this experiment. Leaving the old roles attached would mix two authorization designs and invalidate the comparison. Refresh the model after changing an imported entitlement value.

The active dimension-to-fact relationship must carry the permitted region into FactSales. Filtering an unrelated table containing email addresses is insufficient. For a production entitlement bridge, design and review the relationship path explicitly; do not enable bidirectional security everywhere as a blanket repair. Test each affected fact table and any separate summary table.

-- RegionByIdentity: table filter on DimRegion
[AllowedUPN] = USERPRINCIPALNAME()

-- Separate diagnostic measures, not role filters
Observed UPN = USERPRINCIPALNAME()
Visible Orders = COUNTROWS(FactSales)
Visible Amount = SUM(FactSales[Amount])

Source: Microsoft: RLS model design guidance ↗

Observe the identity that actually reaches the model

Put Observed UPN on the isolated acceptance page and have each real user read it. Compare the returned value with AllowedUPN instead of assuming that a display name, email alias, or invitation address is the identifier used by the service. Keep these observations in restricted test evidence; remove the diagnostic page when it is no longer needed.

External guest accounts deserve their own real sign-in test. A guest identity may resolve differently across tenants. Do not mechanically convert every guest address into a guessed #EXT# form. Capture the actual returned value in that environment, verify its ownership, and update the entitlement through the normal approval process.

A zero-row result can be correct authorization but still reveal a broken entitlement load. Distinguish an intentionally unassigned identity from Alice accidentally losing her mapping. Test the former as a negative case and treat the latter as an operational failure. An unknown identity must never trigger an unrestricted default branch in the rule.

Source: Microsoft: USERPRINCIPALNAME DAX reference ↗

Run positive, negative, and overlapping-role cases

The real-account checks below are the release gate. Run them after publication, not just in Desktop. Record observed IDs and totals beside the expected values, along with model version, refresh time, delivery route, effective permissions, and role memberships. A screenshot without that context is weak evidence when a later deployment changes behavior.

For the unmatched-identity case, use a third controlled consumer assigned to RegionByIdentity but absent from DimRegion. Do not confuse that with a person who lacks permission to open the report at all: an access error tests a different boundary. For membership removal, restore the baseline and retest through a new session after the access change takes effect.

In an isolated copy, deliberately assign one consumer to both static roles. Expect the union of the two regions, not an intersection. A restrictive role does not cancel another role that grants rows. Remove the deliberate extra membership afterward and prove the original restricted result returns. Never introduce this negative test into sensitive production content.

CaseExpected visible IDsExpected amount
Alice, EastOnly or correct dynamic mappingE-101, E-102150
Bob, WestOnly or correct dynamic mappingW-201, W-202270
Dynamic role member with no matching mappingNoneNo sales rows; SUM may display blank
Both static roles, isolated overlap testAll four IDs420
Alice attempts West using cleared filters/drillthroughNo West IDsEast-only results remain

Use role simulation as an intermediate check

Desktop View as and the service Test as role are useful for catching a wrong predicate before involving consumers. They do not replace authenticated acceptance tests. Check the selected role and identity context, and remember that reports outside the semantic model workspace are not covered by the same service testing selector.

For DirectQuery with SSO enabled, Test as role is unsupported; validate with actual consumer sessions. Guest and embedded authentication contexts also need their own real execution path. An embedded application using effective identities requires tests through that application and its tokens, which this two-browser procedure does not simulate.

If a live connection delegates the model to Analysis Services, configure and test security at that model boundary. For Direct Lake, review current storage-mode and source-security documentation for the specific model. This Import fixture is a controlled learning baseline, not a promise that source-level permissions or every storage-mode combination have been exercised.

Source: Microsoft: RLS configuration and service testing ↗

Turn a failed observation into a focused investigation

When forbidden IDs appear, inspect elevated permissions, extra roles, report-to-model binding, and the active filter path. When expected IDs disappear, inspect identity values, entitlement freshness, missing keys, role membership, and ordinary report filters. When only totals disagree, compare detail IDs and summary-table behavior before assuming the role itself is wrong.

Test detail pages, drillthrough, totals, and exports where enabled and authorized for that consumer. Separate aggregate tables can disclose information even when the detail fact table is correctly restricted. Ask whether a published total permits a user to infer another region by subtraction. Hiding a field in the report is not a substitute for reviewing its access.

Finish with a repeatable evidence packet and a retest trigger: a role edit, entitlement refresh change, relationship change, new summary table, new distribution route, or workspace permission change. The useful result is a bounded statement about specific identities and data paths. Keep the known fixture so the next release can reproduce that statement instead of starting from an attractive filtered screenshot.

KEEP THESE THREE THINGS

Your next steps

  1. Compare visible row IDs as well as totals for two actual consumer accounts.
  2. Audit inherited permissions and role overlap before changing the filter.
  3. Use real sign-ins for final acceptance; record untested storage modes and access paths.

Sources & official resources

Linked resources checked on 2026-10-27. Technical behavior and provider guidance can change; check the documentation for the version you use.

About this guide and its recommendations

Published by Prep With Proof with AI-assisted drafting. Study routines and examples are editorial suggestions, not official exam instructions or claims of a learner's personal results. Cited provider facts are linked; ownership of recommended Prep With Proof products is disclosed. No competitor endorsement or guaranteed certification outcome is implied.

Suggest a correction →