0
0
Power BIbi_tool~8 mins

Testing RLS in Desktop in Power BI - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - Testing RLS in Desktop
Goal

Understand how Row-Level Security (RLS) works in Power BI Desktop by testing user-specific data access.

Sample Data
OrderIDRegionSalespersonSalesAmount
1001NorthAlice500
1002SouthBob300
1003EastCharlie400
1004NorthAlice700
1005SouthBob200
1006EastCharlie600
Dashboard Components
  • KPI Card: Total Sales
    Formula: Total Sales = SUM(Sales[SalesAmount])
    Result: 2700
  • Table Visual: Sales by Salesperson
    Columns: Salesperson, SalesAmount (SUM)
    Shows sales grouped by salesperson.
  • Table Visual: Sales by Region
    Columns: Region, SalesAmount (SUM)
    Shows sales grouped by region.
  • RLS Role: SalespersonRole
    Filter: [Salesperson] = USERPRINCIPALNAME()
    This restricts data to only the logged-in salesperson's rows.
Dashboard Layout
+----------------------+----------------------+
|      Total Sales     |  Sales by Salesperson |
|       (KPI Card)     |      (Table)         |
+----------------------+----------------------+
|        Sales by Region (Table)               |
+----------------------------------------------+
Interactivity

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.

Self Check

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.

Key Result
Dashboard demonstrating Row-Level Security in Power BI Desktop filtering sales data by salesperson.