Sub topic 11
What Happens When a User Belongs to Several Roles
This chapter assumes you can already create static and dynamic roles in Power BI Desktop, you understand how a role filter travels from a dimension table to a fact table, and you have assigned members to roles in the Power BI service. Here you will learn how Power BI combines the roles of a user who belongs to more than one.
The rule: roles are additive
A person can end up in several roles. The usual causes are:
- You added the person to two roles directly.
- The person belongs to two security groups, and each group is assigned to a different role.
- The person is in a group assigned to a role and is also listed individually in another role.
When this happens, Power BI does not intersect the filters. It takes the union of the rows that each role allows. A row is visible if at least one of the user's roles lets it through.
Suppose the model has two roles:
| Role | Filter on Region table |
|---|---|
| West Sales | `[Region] = "West"` |
| East Sales | `[Region] = "East"` |
A user in only West Sales sees West rows. A user in both roles sees West rows and East rows. Adding a role can only widen what someone sees. It never narrows it.
Why union and not intersection
RLS is an allow list. A role says which rows its members may see. It does not say which rows to remove from some larger set. Two allow lists for the same person mean the person is allowed whatever either list allows.
This has a practical consequence for how you design roles. You cannot build a restriction by stacking roles. If you want a user to see only West rows for products in the Bikes category, you cannot create one role for West and another for Bikes and expect an AND. Put both conditions in one role instead. The filters can be on the same table or on different tables:
[Region] = "West"on the Region table, and
[Category] = "Bikes"on the Product table, both inside a single role. Within one role, filters on different tables combine with AND, because each filter restricts the model and the filters stack through the relationships. Across roles, the combination is OR.
A worked example
Take a model with a Region dimension, a Product dimension, and a Sales fact table. Both dimensions have a one-to-many relationship to Sales. You define three roles.
| Role | Table | Filter expression |
|---|---|---|
| West Only | Region | `[Region] = "West"` |
| Bikes Only | Product | `[Category] = "Bikes"` |
| West Bikes | Region | `[Region] = "West"` |
| West Bikes | Product | `[Category] = "Bikes"` |
What each membership produces:
| User is a member of | Rows the user sees in Sales |
|---|---|
| West Only | All West sales, any category |
| Bikes Only | All Bikes sales, any region |
| West Only and Bikes Only | West sales (any category) plus Bikes sales (any region) |
| West Bikes | Only West sales of Bikes |
The third row surprises many people. Someone in both West Only and Bikes Only sees more than someone in either role alone, and more than someone in West Bikes. If the intent was "West and Bikes", the user was put into the wrong roles.
Multiple roles with dynamic RLS
The same rule applies to dynamic roles. Consider two roles in one model:
- Regional Manager filters the Region table with a lookup into the Security table:
[Region] IN CALCULATETABLE (
VALUES ( Security[Region] ),
Security[UserEmail] = USERPRINCIPALNAME ()
)- Team Lead filters a table that has a manager column:
[ManagerEmail] = USERPRINCIPALNAME ()If a person is a member of both, the rows they see are those allowed by the regional lookup plus those allowed by the manager match. The two filters can sit on different tables. The union is applied to the model as a whole, so a user may see all rows for their regions and also additional rows for the people they manage in other regions.
A good habit is to keep one dynamic role per access pattern and to put all the access data in the security table. Then there is one role, and membership questions disappear. If a person needs two regions, add two rows for them in the Security table. The IN expression returns both regions, and the user sees both. This gives you the union behavior without depending on role membership.
Where overlapping membership comes from
Overlap is rarely a deliberate choice. It tends to appear through group nesting and slow drift.
- Nested or overlapping groups. A user is in
Sales-Westand also inSales-All-Managers. Each group is assigned to a different role. Entra ID group membership decides who is in a role, so changes to groups change roles without anyone opening Power BI. - A "catch-all" role. Someone creates a role with a filter that returns everything, for example
TRUE(), for executives. Anyone who is also in a restrictive role now sees all rows. The catch-all role wins every time, because union with all rows is all rows. - Direct plus group assignment. An analyst is listed by name in a role for a one-off request. Months later the group assignment changes, but the direct entry stays.
- Test accounts. A tester added to every role to check them sees the union of everything.
Roles with no filter on a table
A role does not need a filter on every table. A table with no filter expression in a role is not restricted by that role directly. It is still affected if another table's filter reaches it through a relationship.
A role can also have no filter expressions at all. Members of such a role are allowed to see every row. This is a common source of over-exposure. If you create a role called Everyone and leave the filters empty, any user in it, even one who is also in a strict role, sees all rows.
Check for this in your models. Open Manage roles in Desktop and look for roles where every table is blank.
Seeing the effect while testing
Testing multiple roles is supported. In Desktop, View as lets you tick several roles at once, and the report shows the union. In the service, Test as role also lets you select more than one role.
Use this to confirm that a person's expected combination does what you intend. To verify the surprising case from the worked example, select West Only and Bikes Only together and compare totals with each role alone. The combined total should be at least as large as either one.
A measure helps you see which identity the model is using:
Current User = USERPRINCIPALNAME()Place it in a card while testing. It shows the user name used for the test, which matters for dynamic roles because the name feeds the filter.
Common mistakes
- Expecting AND across roles. Splitting conditions across roles widens access. Put conditions you want to combine into the same role.
- Using a role to deny. There is no deny rule. You cannot create a role "Not Finance" and subtract it. Remove the user from the broader role instead.
- Forgetting groups. Looking only at direct members of a role misses people who arrive through a group. Check group membership as well.
- Leaving an empty role in place. A role with no filters grants full row access to its members.
- Mixing static and dynamic roles without a plan. A user in a static
Westrole and a dynamic role for the same data may see unexpected extras. Prefer one approach per audience.
Auditing a user's effective access
When someone reports seeing too much data, work through this checklist:
- List every role in the semantic model and its filters. Note any role with blank filters or
TRUE(). - For each role, list its members, including security groups.
- Expand each group to see which people are inside it. Look for the user's name.
- Use Test as role with the user's actual roles selected together and compare to what they report.
- Remove the user from the role that grants the extra rows, or tighten that role's filter.
Remember that workspace roles can bypass RLS entirely. Members with the Admin, Member, or Contributor role on the workspace are not restricted by RLS when they view content in that workspace. That is a separate cause from overlapping roles, and you should rule it out first, because no role change fixes it.
Summary of rules
| Situation | Result |
|---|---|
| Filters on different tables in one role | AND: rows must satisfy all filters |
| User in several roles | OR: union of the rows each role allows |
| Role with no filters | Members see all rows |
| Extra rows in the Security table for one user | The `IN` lookup returns all assigned values, so access widens |
| No way to deny | Remove the user from the role that grants access |
Exercise
A user belongs to two roles. Role A filters Region to "West". Role B filters Product Category to "Bikes". Which rows does the user see in the Sales fact table, and how would you change the setup if the intent was to show only West sales of Bikes?
Show answer
The user sees the union: all West sales in any category, plus all Bikes sales in any region. To show only West sales of Bikes, create one role that has both filters, Region = "West" on the Region table and Category = "Bikes" on the Product table, and make the user a member of only that role. Filters in the same role combine with AND.
Exercise
You use one dynamic role with the Security table lookup on Region. A manager needs access to both West and East. Do you add a second role? What do you do instead?
Show answer
No second role is needed. Add two rows for the manager in the Security table, one with West and one with East. The IN lookup over Security[Region] returns both values, so the single role shows both regions.
Exercise
A user in the strict role "West Only" reports seeing every region. Name two causes related to multiple roles that you would check, and one cause unrelated to roles.
Show answer
First, the user may also be in another role, directly or through a security group, that has blank filters or a TRUE() filter, which makes the union cover all rows. Second, the user may be in a role through a group that was added later and grants broader rows. Unrelated to roles, the user may hold the Admin, Member, or Contributor workspace role, which bypasses RLS.