Sample Data
Sales data by user and region to test Row-Level Security (RLS) in Power BI Desktop.
| Cell | Value |
|---|---|
| A1 | User |
| B1 | Region |
| C1 | Sales |
| A2 | Alice |
| B2 | North |
| C2 | 1000 |
| A3 | Bob |
| B3 | South |
| C3 | 1500 |
| A4 | Charlie |
| B4 | East |
| C4 | 1200 |
Sales data by user and region to test Row-Level Security (RLS) in Power BI Desktop.
| Cell | Value |
|---|---|
| A1 | User |
| B1 | Region |
| C1 | Sales |
| A2 | Alice |
| B2 | North |
| C2 | 1000 |
| A3 | Bob |
| B3 | South |
| C3 | 1500 |
| A4 | Charlie |
| B4 | East |
| C4 | 1200 |
CALCULATE(SUM(Sales[Sales]), USERNAME() = Sales[User])A B C +-------+-------+-------+ 1 | User | Region| Sales | +-------+-------+-------+ 2 | Alice | North | 1000 | +-------+-------+-------+ 3 | Bob | South | 1500 | +-------+-------+-------+ 4 | Charlie| East | 1200 | +-------+-------+-------+ Filter references Sales[User] column (A2:A4) and Sales[Sales] column (C2:C4). USERNAME() returns current user.
D +-------+ 1 | Sales | +-------+ 2 | 1000 | +-------+
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