Power BI Intermediate Lesson 8: Row-Level Security (Static and Dynamic)

Power BI Intermediate Lesson 8: Row-Level Security (Static and Dynamic) 1

πŸ“Ž This article includes 3 downloadable practice files ↓

⏱ 2 min read

πŸ“˜ Power BI Intermediate Course Β· Lesson 8 of 10

Advertisement
In this article
  1. Static roles
  2. Dynamic RLS: one role for everyone
  3. Practice

One report, four regional managers, and each must see only their region. Row-level security (RLS) filters the data by who is signed in.

Static roles

Modeling > Manage roles > New: role North, table Customers, filter [Region] = "North". Repeat per region and assign people to roles in the Power BI Service. Simple, but one role per region.

Dynamic RLS: one role for everyone

  1. A RegionUsers table: Email, Region (in the practice model).
  2. Relationship RegionUsers[Region] (one) β†’ Customers[Region] (many), single direction.
  3. Role “Region users”, table RegionUsers, filter [Email] = USERPRINCIPALNAME().

The signed-in user’s row filters Customers, which filters Sales. New manager? Add a row to the table, no model change.

Viewed as Sees total sales
[email protected] β‚Ή1,01,37,231 (North)
[email protected] β‚Ή71,78,449 (West)
[email protected] β‚Ή78,68,565 (South)
[email protected] β‚Ή29,10,331 (East)

Test in Desktop: Modeling > View as > Other user + the role.

⚠️ RLS applies only to viewers. Workspace Admins, Members and Contributors see everything. Give managers Viewer access or share through an app.

Practice

Import pbi-intermediate-model.xlsx into Power BI Desktop (free), create the relationships listed at the top of the .dax file, mark the Date table as a date table and add this lesson’s measures. Compare your card and table values with the lesson’s sheet in the expected-results file. Those numbers were worked out independently in Python from the same data, so a mismatch means a filter or relationship to check.

πŸ“Ž Practice files for this article

⬇ Download all 3 files (ZIP Β· 61 KB)

  • πŸ“—
    Practice model (Excel)Two years of sales (700 orders, FY 2024-25 and 2025-26) with Customers, Products, a full Date table, Targets and RegionUsers.
    ⬇ XLSX Β· 63 KB
  • πŸ“„
    Lesson 8 measures (.dax)Every measure from this lesson, ready to paste into Power BI Desktop.
    ⬇ DAX Β· 843 B
  • πŸ“—
    Expected resultsThe numbers your measures should show, one sheet per lesson.
    ⬇ XLSX Β· 11 KB

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong