Dashboard Mode - RLS with multiple roles
Dashboard Goal
This dashboard shows sales data filtered by user roles using Row-Level Security (RLS). It answers: "How do sales differ when users have different roles like Region Manager or Product Manager?"
This dashboard shows sales data filtered by user roles using Row-Level Security (RLS). It answers: "How do sales differ when users have different roles like Region Manager or Product Manager?"
| OrderID | Region | Product | SalesAmount | SalesDate |
|---|---|---|---|---|
| 1001 | East | Bike | 1200 | 2024-01-15 |
| 1002 | West | Helmet | 300 | 2024-01-20 |
| 1003 | East | Helmet | 450 | 2024-02-10 |
| 1004 | North | Bike | 700 | 2024-02-15 |
| 1005 | West | Gloves | 150 | 2024-03-05 |
| 1006 | South | Bike | 900 | 2024-03-10 |
| 1007 | East | Gloves | 200 | 2024-03-15 |
Total Sales = SUM(Sales[SalesAmount])Two roles defined in Power BI Desktop:
Sales[Region] to allowed regions (e.g., East, West)Sales[Product] to allowed products (e.g., Bike, Helmet)Users can belong to one or both roles. The effective filter is the intersection of all roles assigned.
+----------------------+----------------------+ | Total Sales | Sales by Region | | (KPI Card) | (Bar Chart) | +----------------------+----------------------+ | Sales by Product | Detailed Sales | | (Bar Chart) | (Table) | +----------------------+----------------------+
Filters and slicers are controlled by RLS roles, so users only see data allowed by their roles.
If a user belongs to the Region Manager Role for East and the Product Manager Role for Bike, which sales records will they see?
Region = 'East' AND Product = 'Bike'.