Sub topic 9
Assigning users and groups to roles in the service
This chapter assumes you have already built and tested roles in Power BI Desktop. You should know how a static or dynamic role filters a table, and you should have a Power BI workspace and a Microsoft Entra ID account. Roles you create in Desktop do nothing until you publish the semantic model and add members to each role in the service.
What assignment does
A role is a named set of table filters stored in the semantic model. A member is a person or group that the role applies to. A user who is not a member of any role gets no RLS filtering from roles. What that user sees depends on their permissions, which later chapters cover. Membership is how you connect people to filters.
Membership is stored with the semantic model in the service, not in the .pbix file. If you republish the model from Desktop, the roles and their members normally stay in place. Check them after any republish that changes role names.
Assign members step by step
- Publish the model from Power BI Desktop to a workspace.
- In the workspace, find the semantic model. Open its More options (the three dots) menu and choose Security.
- Select a role in the left pane. The role names are the ones you defined in Desktop.
- In the Members box, type a name, an email address, or a security group name.
- Select Add, then check that the member appears in the list.
- Select Save.
Repeat for each role. If a role has no members, nobody gets its filter, so check that every role you intend to use has at least one member.
Users, groups, and which to choose
You can add individual accounts or Microsoft Entra security groups. The service accepts these types:
| Member type | Works for RLS | Notes |
|---|---|---|
| Individual user account | Yes | Use the sign-in name (UPN) shown in Entra ID. |
| Microsoft Entra security group | Yes | Everyone in the group receives the role. |
| Mail-enabled security group | Yes | Treated the same as a security group. |
| Microsoft 365 group | Yes | Supported for assignment. |
| Distribution list | No | It has no security identity, so it can't be added. |
Prefer groups for static roles. When someone changes teams, an administrator updates group membership in Entra ID and you don't need to edit the semantic model. For example, you could create a group named PBI-Sales-West and add it to the West role once.
Dynamic roles are different. A dynamic role usually has one broad group, such as all sales staff, and the security mapping table decides what each person sees. The role filter compares each user's sign-in name to a column in your data, as in this filter on the Region dimension:
[Region] IN CALCULATETABLE (
VALUES ( Security[Region] ),
Security[UserEmail] = USERPRINCIPALNAME ()
)Here the group only controls who gets the role. The mapping table controls the rows. Adding a new salesperson means adding them to the group and adding rows to the Security table.
How the flow works
Common mistakes
- Typing a name that doesn't resolve. Use the exact account or group name from Entra ID. If the name can't be found, the service shows an error and doesn't add it.
- Expecting a Desktop test to match the service. Desktop's View as uses roles you pick on the spot. Service membership can differ. Use Test as role on the Security page to check the real setup.
- Mismatched sign-in names in dynamic roles.
USERPRINCIPALNAME()returns the account's UPN. The values in yourSecuritytable must match it exactly, or the user sees an empty report. - Assuming assignment is enough. A user with an elevated workspace role can bypass RLS. The next chapter covers which roles do.
Exercise
Exercise
You created a dynamic role named SalesUsers with the filter [ManagerEmail] = USERPRINCIPALNAME(). After publishing, a new employee opens the report and sees nothing. Name two things to check in the service and the data.
Show answer
First, check that the employee, or a security group they belong to, is a member of SalesUsers on the model's Security page. Second, check that their sign-in name appears in the ManagerEmail column exactly as USERPRINCIPALNAME() returns it, including spelling and domain. Without a match, the filter returns no rows.