๐ Dynamic Row-Level Security (RLS) in Power BI
Dynamic RLS lets you automatically filter data based on the logged-in user's identity, without hardcoding user roles. It’s scalable, secure, and highly useful in multi-user environments.
๐ง How It Works
1️⃣ Create a User Mapping Table (e.g., UserRegion)
2️⃣ Establish a relationship between the UserRegion table and your main data (e.g., Sales).
3️⃣ Define a DAX Filter on the role:
๐ค Power BI dynamically matches the signed-in user with the corresponding row in the table.
๐ฆ Setup Steps
-
Create
UserRegiontable -
Link it to your main data model
-
Go to Manage Roles → Add filter using
USERPRINCIPALNAME() -
Publish to Power BI Service
-
Assign security roles in the dataset settings
๐ Example Scenario
Bob logs in → Power BI checks UserRegion → Filters Sales to only show data where Region = "South" ๐
✅ No separate reports
✅ One dataset
✅ User-specific data control
Comments
Post a Comment