🔄 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
UserRegion
table -
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