Sub topic 9
Assigning users and groups to roles in the service
This chapter covers what happens after you publish a model with roles. A role does nothing until you add members to it in the Power BI service. It assumes you can already create roles in Power BI Desktop, you know the difference between static and dynamic roles, and you have a workspace in which you can publish. You also need a Microsoft Entra ID (formerly Azure AD) work or school account.
Where role membership lives
Roles are defined in the semantic model. Members are assigned to those roles in the Power BI service. Desktop has no place to add members, so publishing a model does not carry any assignments with it.
This split has three consequences:
- Publishing a model with roles gives you roles with no members. Nobody is restricted by those roles until you assign them.
- Republishing over an existing model keeps the existing role assignments as long as the role names still match. If you rename or delete a role in Desktop, you must assign members again.
- The role definition and the member list can be maintained by different people. A developer writes the DAX filter. A workspace admin or the model owner manages who is in the role.
Opening the Security page
You manage role membership on the semantic model, not on the report.
- Open the workspace that holds the semantic model.
- Find the semantic model in the list. Do not select the report with the same name.
- Select the More options menu (the three dots) next to the model, then choose Security.
- In the left pane, select the role you want to manage.
- In Members, type a name or email address, select it from the suggestions, and choose Add.
- Choose Save.
If you do not see Security, you probably lack the right permission on the model. You need to be the model owner or have the Build or higher workspace access that lets you manage the model. If the model has no roles, the page shows nothing to select.
What you can add as a member
The Members box accepts several kinds of identities from your Entra ID tenant:
| Member type | Example | Notes |
|---|---|---|
| Individual user | `[email protected]` | Must be a user in your tenant, or a guest user that exists in it. |
| Microsoft Entra security group | `Sales-West-Readers` | Best choice for most teams. |
| Mail-enabled security group | `Sales-West-Mail` | Works the same as a security group. |
| Microsoft 365 group | `Sales Team` | Supported for membership in roles. |
| Distribution list | `[email protected]` | Not supported. It is not a security principal. |
A distribution list is only a mailing list. Entra ID cannot use it to decide who a person is when they sign in, so the service rejects it. If your organization manages access through distribution lists, ask for a security group instead.
Prefer groups over individual users
You can add 500 individual people to a role, but you should not. Groups have clear advantages:
- Membership changes happen in Entra ID. You do not have to reopen the Security page when someone joins or leaves a team.
- The member list in the service stays short and readable.
- The same group can be used in several roles, in several models, and in access control for workspaces and apps.
- Audits are easier. You can answer "who can see West data?" by looking at one group.
Individual assignments make sense for a small test, for a single executive, or for an exception that you want visible in the model.
A group-based role works for static roles in the obvious way. Each static role (for example West and East) gets its own group. For a dynamic role, you usually add one group that contains everyone who should be filtered by the security table, because the DAX uses USERPRINCIPALNAME() to decide what each person sees.
Static roles and dynamic roles in the service
The assignment step is the same for both kinds of role, but the effect differs.
Static roles
You create one role per audience, such as West with [Region] = "West". In the service, you add the people who should see West data to that role. Someone who is not in any role sees nothing if they are restricted by RLS at all (see the next chapter on who is exempt).
Dynamic roles
You create a single role, for example BySecurityTable, with a filter such as:
[Region] IN CALCULATETABLE (
VALUES ( Security[Region] ),
Security[UserEmail] = USERPRINCIPALNAME ()
)In the service, you add everyone who should be filtered to that one role. The role gives them access to the model. The Security table decides which rows. Adding a person to the role without adding a row for them in the Security table gives them an empty report, because the filter returns no regions.
This is why assignment and data both matter. A user needs both a role membership and a matching row in the mapping data.
A worked example
Suppose your model has the dynamic role BySecurityTable above, and this table in the Security mapping:
| UserEmail | Region |
|---|---|
| `[email protected]` | West |
| `[email protected]` | North |
| `[email protected]` | East |
You publish the model to the workspace Sales Analytics. You then do the following in the service.
- Create an Entra security group called
Sales-RLS-Usersand add Maria and Li to it. - In the workspace, open More options on the semantic model and choose Security.
- Select
BySecurityTable. - Type
Sales-RLS-Users, select it, and choose Add, then Save.
When Maria opens a report built on this model, USERPRINCIPALNAME() returns [email protected]. The filter finds West and North in the Security table, and she sees those two regions. Li sees only East. If you add a third person to Sales-RLS-Users and forget the Security table row, that person opens a report with no data.
You can confirm this behavior with the measure from the earlier chapters:
Current User = USERPRINCIPALNAME()Place it in a card visual and each person sees their own sign-in name.
Testing an assignment
After saving, test the role before you tell anyone. The Security page has a More options menu next to each role (the three dots) with Test as role. This opens a report view that applies the role's filter.
You can test in two ways:
- Test as role with no extra user shows what the role's filter returns. For a dynamic role, this uses your own identity, so you might see an empty report if you are not in the Security table.
- Now viewing as lets you add a specific person in the box and see the report as that user would. This is the way to test a dynamic role for another person.
Testing in the service does not prove that a particular person is in the role. It proves that the filter works for the identity you entered. To check actual membership, open the Security page and read the member list, or look at the group in Entra ID.
When assignments take effect
Changes to role members do not always apply immediately for people who are already signed in. A user who has a report open may keep the old filter until their session refreshes. Group membership also depends on Entra ID, where changes can take some time to propagate. If a person was just added to a group, ask them to sign out and back in, or wait a few minutes, before you assume the assignment has failed.
Changes to the role definition (the DAX filter) require a republish from Desktop. Changes to membership do not.
Common mistakes
- Assigning on the report instead of the model. There is no Security page for reports. Look for the semantic model in the workspace list.
- Adding a distribution list. The service will not resolve it. Use a security group.
- Renaming a role in Desktop. After republishing, the new role has no members. Add them again.
- Forgetting that workspace roles can bypass RLS. If the people you assigned are Admin, Member, or Contributor in the workspace, RLS does not restrict them, no matter what the role says. The next chapter covers this.
- Checking only your own view. As the model author, you probably have a workspace role that bypasses RLS. Use Test as role instead of looking at the normal report.
- Assigning a user to a role but not to the Security table. In dynamic RLS, the role does not grant rows. The mapping data does.
Practice
Exercise
You published a model with a dynamic role named BySecurityTable. A new analyst, Priya, was added to the Entra group Sales-RLS-Users, which is a member of that role. She reports that her report is completely empty. Name two things to check, and say which one is the more likely cause.
Show answer
First, check whether the Security mapping table has a row for Priya's sign-in name (the value USERPRINCIPALNAME() returns for her). Second, check that the group membership has taken effect, by asking her to sign out and back in or by waiting a few minutes. The missing row in the Security table is the more likely cause. Priya is in the role, so she is filtered, but with no matching row the filter returns no regions and therefore no data. You can confirm by using Now viewing as with her email address in Test as role.
Exercise
A colleague wants to restrict a report to the West sales team and proposes adding the distribution list [email protected] to the role West. Why will this fail, and what should they do instead?
Show answer
A distribution list is not a security principal, so the Power BI service cannot use it to identify the person who signs in, and it will not be accepted as a role member. They should create a Microsoft Entra security group (or a mail-enabled security group), put the West team in it, and add that group to the role on the semantic model's Security page.