Dashboard Mode - Testing RLS in Desktop
Goal
Understand how Row-Level Security (RLS) works in Power BI Desktop by testing user-specific data access.
Understand how Row-Level Security (RLS) works in Power BI Desktop by testing user-specific data access.
| OrderID | Region | Salesperson | SalesAmount |
|---|---|---|---|
| 1001 | North | Alice | 500 |
| 1002 | South | Bob | 300 |
| 1003 | East | Charlie | 400 |
| 1004 | North | Alice | 700 |
| 1005 | South | Bob | 200 |
| 1006 | East | Charlie | 600 |
Total Sales = SUM(Sales[SalesAmount])+----------------------+----------------------+ | Total Sales | Sales by Salesperson | | (KPI Card) | (Table) | +----------------------+----------------------+ | Sales by Region (Table) | +----------------------------------------------+
The RLS role filters all visuals automatically based on the logged-in user. When testing in Power BI Desktop, use the View As feature to simulate different salespersons. For example, selecting 'Alice' will show only her sales in all visuals.
If you use the View As feature to test the RLS role for 'Bob', which salespersons' data will appear in the dashboard?
Answer: Only rows where Salesperson = 'Bob' will appear in all visuals.
View as Roles in Power BI Desktop?Table[Column] = "Value" to filter rows.Customers[Country] = "USA", what will COUNTROWS(Customers) return when viewing as this role if the Customers table has 100 rows with 30 from USA?Country = "USA", so only 30 rows remain visible.Orders[Amount] > 1000 but when testing with 'View as Roles', all data is visible. What is the most likely cause?Orders[Amount] > 1000 is correct. If data had no matching rows, filtered data would be empty, not all visible.RoleA filters Sales[Region] = "East" and RoleB filters Sales[Region] = "West". How can you test combined access for a user assigned to both roles in Power BI Desktop?Pass the test and this pattern moves unknown