Bird
Raised Fist0
Power BIbi_tool~15 mins

RLS with multiple roles in Power BI - Real Business Scenario

Choose your learning style10 modes available
Scenario Mode
👤 Your Role: You are a Power BI developer at a retail company.
📋 Request: Your manager wants you to create a sales report that restricts data access based on user roles: Sales Managers should see all regions, Regional Managers should see only their assigned region, and Sales Reps should see only their own sales data.
📊 Data: You have a Sales table with columns: SalesID, SalesRep, Region, Product, SalesAmount, and Date. You also have a Users table with columns: UserName, Role, and Region (Region is blank for Sales Managers).
🎯 Deliverable: Create a Power BI report with Row-Level Security (RLS) configured for multiple roles as described, so users see only the data they are allowed to access.
Progress0 / 8 steps
Sample Data
SalesIDSalesRepRegionProductSalesAmountDate
1AliceNorthWidget5002024-01-10
2BobSouthGadget7002024-01-15
3CharlieEastWidget3002024-01-20
4AliceNorthGizmo2002024-02-05
5BobSouthWidget4002024-02-10
6CharlieEastGadget6002024-02-15
7DianaWestGizmo8002024-02-20
8DianaWestWidget3002024-03-01

UserNameRoleRegion
manager1Sales Manager
regional_northRegional ManagerNorth
regional_southRegional ManagerSouth
aliceSales RepNorth
bobSales RepSouth
charlieSales RepEast
dianaSales RepWest
1
Step 1: Load the Sales and Users tables into Power BI and create a relationship between Sales[Region] and Users[Region].
In Power BI Desktop, go to Model view, drag Sales[Region] to Users[Region] to create a relationship.
Expected Result
Relationship created allowing filtering Sales data by User's Region.
2
Step 2: Create a DAX calculated column in the Users table to normalize UserName to lowercase for matching with USERNAME() function.
NormalizedUser = LOWER(Users[UserName])
Expected Result
New column NormalizedUser with lowercase usernames.
3
Step 3: Create three RLS roles in Power BI Desktop: SalesManager, RegionalManager, and SalesRep.
In Modeling tab, Manage Roles, create roles with filters on Users table.
Expected Result
Roles created for RLS configuration.
4
Step 4: Define the SalesManager role with no filter to allow access to all data.
No filter
Expected Result
Sales Managers see all sales data.
5
Step 5: Define the RegionalManager role with filter to allow access only to their assigned region.
Users[Role] = "Regional Manager" && Users[NormalizedUser] = LOWER(USERNAME())
Expected Result
Regional Managers see sales data only for their region.
6
Step 6: Define the SalesRep role with filter to allow access only to their own sales data.
Users[Role] = "Sales Rep" && Users[NormalizedUser] = LOWER(USERNAME())
Expected Result
Sales Reps see only their own sales records.
7
Step 7: Test each role by using 'View as Roles' in Power BI Desktop to verify data visibility matches the role restrictions.
Use 'View as Roles' and select each role to check filtered data.
Expected Result
Sales Manager sees all data; Regional Manager sees only their region; Sales Rep sees only their sales.
8
Step 8: Publish the report to Power BI Service and assign users to the corresponding RLS roles in the dataset security settings.
In Power BI Service, go to dataset security, add users to SalesManager, RegionalManager, or SalesRep roles.
Expected Result
Users see data filtered by their assigned roles when accessing the report online.
Final Result
Power BI Sales Report Dashboard

+-----------------------------+
| Region | SalesRep | SalesAmt |
+-----------------------------+
| North  | Alice    | $700     |
| South  | Bob      | $1100    |
| East   | Charlie  | $900     |
| West   | Diana    | $1100    |
+-----------------------------+

Note: Data shown depends on logged-in user's role and region access.
✓Sales Managers can see all sales data across all regions.
✓Regional Managers see sales data only for their assigned region.
✓Sales Reps see only their own sales records.
✓RLS ensures data security and proper data access control in the report.
Bonus Challenge

Extend the RLS to allow Regional Managers to see sales data for their region plus any region where they have sales reps assigned temporarily.

Show Hint
Create a bridge table listing regions accessible per Regional Manager and update RLS filter to check membership in that list.

Practice

(1/5)
1. What does RLS with multiple roles in Power BI allow you to do?
easy
A. Control data access by assigning users to one or more roles
B. Create multiple dashboards for different users
C. Automatically refresh data at different times
D. Change the data source connection dynamically

Solution

  1. Step 1: Understand RLS purpose

    RLS (Row-Level Security) controls which data a user can see based on roles.
  2. Step 2: Recognize multiple roles effect

    Assigning multiple roles means a user sees data allowed by any of those roles (combined access).
  3. Final Answer:

    Control data access by assigning users to one or more roles -> Option A
  4. Quick Check:

    RLS multiple roles = combined data access [OK]
Hint: RLS controls data visibility by roles combined with OR logic [OK]
Common Mistakes:
  • Confusing RLS with dashboard creation
  • Thinking RLS changes data refresh
  • Believing RLS changes data source
2. Which of the following is the correct way to define a role filter in Power BI Desktop for multiple roles?
easy
A. Assign users directly in Power BI Desktop without roles
B. Use DAX filter expressions for each role separately under 'Manage Roles'
C. Write SQL queries inside Power BI Desktop to filter roles
D. Create a single role and assign all users to it

Solution

  1. Step 1: Understand role creation in Power BI Desktop

    Roles are created by defining DAX filter expressions under 'Manage Roles'.
  2. Step 2: Recognize multiple roles setup

    Each role has its own filter; multiple roles mean multiple filters defined separately.
  3. Final Answer:

    Use DAX filter expressions for each role separately under 'Manage Roles' -> Option B
  4. Quick Check:

    Role filters use DAX expressions in 'Manage Roles' [OK]
Hint: Define each role filter with DAX in 'Manage Roles' [OK]
Common Mistakes:
  • Trying to use SQL queries inside Power BI Desktop
  • Assigning users directly without roles
  • Using only one role for all users
3. Given two roles in Power BI: RoleA filters 'Region' = "East" and RoleB filters 'Sales' > 1000. If a user is assigned both roles, what data will they see?
medium
A. Data where Sales > 1000 but Region can be any value
B. Only data where Region = "East" AND Sales > 1000
C. Data where Region = "East" but Sales can be any value
D. Data where Region = "East" OR Sales > 1000

Solution

  1. Step 1: Understand multiple roles filter logic

    When a user has multiple roles, Power BI combines filters with OR logic, not AND.
  2. Step 2: Apply OR logic to given roles

    User sees data where Region = "East" OR Sales > 1000, meaning either condition allows data visibility.
  3. Final Answer:

    Data where Region = "East" OR Sales > 1000 -> Option D
  4. Quick Check:

    Multiple roles combine filters with OR [OK]
Hint: Multiple roles combine filters with OR, not AND [OK]
Common Mistakes:
  • Assuming filters combine with AND logic
  • Confusing role assignment with user permissions
  • Thinking roles restrict data more strictly
4. You created two roles with filters but users assigned to both roles see all data. What is the most likely cause?
medium
A. Users were not assigned to roles in Power BI Service
B. Roles were created but not saved in Power BI Desktop
C. Data source connection is broken
D. Filters use AND logic instead of OR, causing no matching data

Solution

  1. Step 1: Check user assignment to roles

    Even if roles exist, users must be assigned in Power BI Service to see filtered data.
  2. Step 2: Understand effect of missing assignment

    If users are not assigned, RLS filters do not apply, resulting in all data visible.
  3. Final Answer:

    Users were not assigned to roles in Power BI Service -> Option A
  4. Quick Check:

    User assignment in service is required for RLS [OK]
Hint: Assign users to roles in Power BI Service to enable RLS [OK]
Common Mistakes:
  • Assuming filters combine with AND logic
  • Ignoring user assignment step
  • Blaming data source connection first
5. You have three roles: Role1 filters 'Country' = "USA", Role2 filters 'Product' = "A", Role3 filters 'Year' = 2023. A user is assigned Role1 and Role3. Which DAX expression correctly represents the combined filter effect for this user?
hard
A. FILTER(Table, Table[Country] = "USA" && Table[Product] = "A" && Table[Year] = 2023)
B. FILTER(Table, Table[Country] = "USA" && Table[Year] = 2023)
C. FILTER(Table, Table[Country] = "USA" || Table[Year] = 2023)
D. FILTER(Table, Table[Product] = "A" || Table[Year] = 2023)

Solution

  1. Step 1: Understand role filter combination logic

    When a user has multiple roles, Power BI combines filters with OR logic, so data matching any role filter is visible.
  2. Step 2: Apply OR logic to Role1 and Role3 filters

    The combined filter is where Country = "USA" OR Year = 2023, ignoring Role2 since user is not assigned to it.
  3. Final Answer:

    FILTER(Table, Table[Country] = "USA" || Table[Year] = 2023) -> Option C
  4. Quick Check:

    Multiple roles combine filters with OR [OK]
Hint: Combine multiple role filters with OR in DAX [OK]
Common Mistakes:
  • Using AND instead of OR to combine filters
  • Including filters from roles not assigned to user
  • Confusing role filters with user permissions
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard