Short answer: row-level security (RLS) limits which rows of a semantic model a person can see. You define roles with DAX filters in Power BI Desktop, publish, and add people or groups to each role in the service. A dynamic role uses USERPRINCIPALNAME() and a security table, so one role serves everyone. RLS applies to people with the Viewer role on the workspace, or who see the report through an app or a share; workspace Admins, Members and Contributors see all rows.
One report for every region, each manager seeing only theirs, is the usual goal. The model does the filtering, so every visual, export and Analyze in Excel connection respects it.
Static or dynamic roles?
- a role per region, with a fixed filter like Region = "West"
- simple, but one role per value
- one role
- a security table maps each sign-in to what it may see
How does a dynamic role filter the facts?
- 1Sign-inanna@contoso.com
- 2Security tableAnna may see West and North
- 3Regionfiltered to West and North
- 4Salesonly those regions' rows reach every visual
The security table has one row per person and region. Relate it to the Region dimension, and the role filters the security table only:
-- Role "By user", filter on the table UserRegion
UserRegion[Email] = USERPRINCIPALNAME ()The filter flows from UserRegion to Region to Sales. For it to cross from UserRegion to Region, that relationship needs Apply security filter in both directions, or write the filter on Region with a lookup:
-- Role "By user", filter on the table Region
Region[RegionID] IN
CALCULATETABLE ( VALUES ( UserRegion[RegionID] ), UserRegion[Email] = USERPRINCIPALNAME () )How do you test it?
In Power BI Desktop, Modeling > View as shows the report as a role, and with Other user as a given email. In the service, Test as role on the semantic model's security page does the same with real sign-ins. Test a person with two regions and a person with none: someone with no row in the security table should see nothing, not everything.
What goes wrong?
- Testing as a workspace member. Members see all rows. Test with a Viewer, or with View as.
- Totals that leak. A measure that removes filters with
ALLstill respects RLS, but a "share of total" then means share of what the person may see. Decide which one the report means. - Email case and guests.
USERPRINCIPALNAME()returns the sign-in as Entra has it; guest users can look different. Compare emails in lower case.
Where can you check this?
- Microsoft Learn: Row-level security (RLS) with Power BI
- Microsoft Learn: Row-level security (RLS) guidance in Power BI Desktop
Where do you start?
The open course Row-level security that holds builds a role, one role for everyone, and the tests, in a model of your own.