Sub topic 1
What row-level security does and why you need it
Prerequisites
This chapter assumes you can do the following:
- Load data into Power BI Desktop and build a basic report.
- Read a star schema: fact tables, dimension tables, and one-to-many relationships.
- Write simple DAX comparisons such as
[Region] = "West". - Sign in with a Microsoft Entra ID (Azure AD) work or school account that can use a Power BI workspace.
The problem RLS solves
Suppose one sales report serves three regional managers. Each manager should see only their own region's numbers. You could publish three copies of the report, each with its own filtered data. That works at first, but you then maintain three datasets, and every change has to be repeated three times.
Row-level security (RLS) removes that duplication. You publish one semantic model and define rules inside it. When someone opens a report, Power BI applies the rules for that person and hides the rows they may not see. Every visual, measure, and total is calculated only from the permitted rows.
How RLS works
RLS is built from three parts:
- A role. A named group of rules, for example "West Managers".
- A table filter expression. A DAX expression that returns true or false for each row of one table. Only rows that return true stay visible.
- Members. The users or security groups assigned to the role in the Power BI service.
Here is the simplest filter expression. Placed on a Region dimension table, it keeps only the rows for the West region:
[Region] = "West"The filter does not stop at the Region table. It travels through relationships to related tables, so the fact table also shows only West sales. A later chapter covers how that propagation works.
Static and dynamic roles
There are two common styles of role:
| Style | Filter | Roles needed | Typical use |
|---|---|---|---|
| Static | Fixed values written in the DAX, such as `[Region] = "West"` | One per audience | A few stable groups |
| Dynamic | Uses the signed-in user's identity, for example with `USERPRINCIPALNAME()` | Often one for everyone | Many users, or assignments that change often |
This tutorial covers static roles first because they show the mechanics clearly. Dynamic roles come later and build on the same ideas.
What RLS restricts, and what it does not
RLS restricts rows. It does not hide columns or tables, and it does not encrypt data. If a user may see a row, they may see every column in that row. Column-level restrictions need a different feature, object-level security.
RLS also applies only to the people you place in a role. Some workspace roles skip RLS entirely, and a user who has more access than you intended will see everything. The tutorial returns to this in the chapters on workspace roles and limits.
Where you build and enforce it
You define roles in Power BI Desktop. You then publish the model and assign members to each role in the Power BI service. The rules are stored in the model, but they take effect for a person only after that person is a member of a role. The rest of the tutorial follows this order: write the filter, test it, assign users, then troubleshoot.
Exercise
A manager belongs to a role with the filter [Region] = "West" on the Region table. She opens a report and sees West sales only, but each row still shows the customer's phone number. Is this an RLS failure? Why or why not?
Show answer
No. RLS filters rows, not columns. The West rows are correctly the only ones visible, and every column in a permitted row remains visible. To hide the phone number column you would need a different feature, such as object-level security, or you would remove the column from the model.