Set up Power BI row-level security (RLS): design and validate user-specific filters
Row-level security (RLS) limits which rows users can see in a Power BI semantic model. Define roles and DAX filters in Desktop, assign users or security groups to roles in the Service, then verify the results with the permissions actual readers will have. RLS applies to workspace Viewers, but not to Admin, Member, or Contributor roles, so review workspace access too.
Set up Power BI row-level security (RLS): design and validate user-specific filters
Row-level security (RLS) limits which rows users can see in a Power BI semantic model. Define roles and DAX filters in Desktop, assign users or security groups to roles in the Service, then verify the results with the permissions actual readers will have. RLS applies to workspace Viewers, but not to Admin, Member, or Contributor roles, so review workspace access too.
This guide focuses on Import and DirectQuery models where RLS roles can be defined in Power BI. For Analysis Services or Azure Analysis Services live connections, define RLS in the Analysis Services model.
Choose static or dynamic roles
Static RLS gives each role a fixed condition. For example, a West role can use the filter [Region] = "West", so its members see only West rows. This is easy to understand for a few stable groups, but the number of roles and memberships can grow as regions or teams change.
Dynamic RLS compares the signed-in user's identity with a mapping table so one role can return different rows for different people. For example, if a table maps users to regions and model relationships are configured correctly, a role filter such as [UserEmail] = USERPRINCIPALNAME() can select the mapping row for the current user. This avoids creating one role per user, but identity values and relationships must be accurate.
In Power BI Service, USERPRINCIPALNAME() returns the user's sign-in identifier (UPN). It often looks like an email address, but may differ from an email alias. In Desktop, USERNAME() can return DOMAIN\user, while in the Service it can return a UPN. Do not assume identity formats are the same across environments. Microsoft: Row-level security in Power BI · Microsoft: RLS design guidance
Define roles and filters in Desktop
Prepare the model tables and relationships. For dynamic filtering, include a mapping table that connects user identifiers to allowed data.
In Power BI Desktop, open **Modeling > Manage roles**.
Select **New**, name the role clearly, and note that commas aren't allowed in role names.
Choose a table and define a condition in the default editor or DAX editor. The expression returns TRUE or FALSE for each row.
Use the DAX editor for rules that need USERPRINCIPALNAME() or USERNAME(). For example, a static filter is:
[Region] = "West"A dynamic filter can compare the mapping table identifier with the current UPN:
[UserEmail] = USERPRINCIPALNAME()Save the role and use **Modeling > View as** to check that only the expected rows remain. Confirm relationships propagate the filter to the required tables.
Publish the model and report to the Service. Role definitions are published from Desktop; members are assigned in the Service.
A filter is evaluated for each table row, and only rows that return TRUE remain. Missing user mappings or a mismatched sign-in identifier can make expected rows disappear. When a user belongs to multiple roles, their filters combine additively and the user can see the union of rows allowed by those roles. A row excluded by one role can therefore be visible through another role. Prefer one role that contains the user's intended access; if multiple roles are necessary, validate the final union.
Microsoft: Power BI row-level security · Microsoft: RLS design guidance
Assign members to roles in the Service
After publishing, open Security for the semantic model in the workspace. Select a role and add user names, email addresses, or supported security groups. Centrally managed security groups can simplify membership. Power BI groups and Microsoft 365 groups aren't supported for RLS membership. Use a supported group type, such as a Microsoft Entra security group, distribution group, or mail-enabled group.
The model must already contain RLS roles defined in Desktop or the Service model editor before you can manage membership. Role membership and workspace access are separate. Consumers need permissions that enforce RLS; a workspace Admin, Member, or Contributor role can bypass it. Microsoft: Manage RLS role membership · Microsoft: Workspace roles
Validate filters with actual permissions
In the Service security settings, open the role menu and select Test as role. Check:
Does the report show only the rows intended for the role?
Do totals and visuals reflect the filtered rows?
For dynamic RLS, does the identity match the mapping table?
If someone belongs to multiple roles, is the combined result intended?
Test as role does not fully simulate a user's authentication. It isn't supported for DirectQuery models with SSO enabled. For external B2B guests or embedded users whose identity resolution can differ, test by opening the report as that actual account. A guest's USERPRINCIPALNAME() may look like an email address or may use a tenant-specific #EXT# form; the mapping table must match the value the Service returns. Microsoft: Validate RLS roles
Check performance and security boundaries
RLS filters are applied to queries and can affect performance. Microsoft guidance generally recommends filtering dimension tables rather than fact tables and using active relationships to propagate filters. If you enable bidirectional security filtering, validate both performance and filter direction before production use.
RLS restricts rows; it doesn't restrict access to model objects such as tables, columns, or measures. Object-level security (OLS) may be needed for that. RLS also doesn't apply to workspace Admin, Member, or Contributor roles. Don't give those edit roles to people who must not see the full data. Microsoft: RLS design guidance · Microsoft: Workspace roles and RLS
Troubleshoot common failures
**A user sees no rows:** Check that the mapping table includes the returned UPN and uses the same format.
**A user sees too many rows:** Check the DAX condition, multiple role membership, active relationships, and filter direction. Make every branch explicit so an unexpected identity doesn't grant all rows.
**The report opens without RLS:** Check whether the user has Admin, Member, or Contributor workspace access. Use Viewer or suitable app read access when RLS must apply.
**Only external guests see different data:** Test the actual guest identity and group membership. Some B2B configurations may not evaluate group-based membership as expected; direct role assignment may be required.
**Test as role differs from the real result:** Consider the DirectQuery-plus-SSO limitation and verify as an actual Viewer or guest.
RLS is not a way to hide report pages. Design the model, roles, identity mapping, and workspace permissions together, then validate with representative accounts so each person sees only intended rows. This article provides an example workflow and does not claim to have tested a real Power BI tenant or role configuration.