Consider a table Sales with columns SalesAmount and UserEmail. A dynamic RLS filter uses USERNAME() to filter rows where UserEmail matches the logged-in user.
Given this DAX measure:
Filtered Sales = CALCULATE(SUM(Sales[SalesAmount]), Sales[UserEmail] = USERNAME())
If the logged-in user is john.doe@company.com and the Sales table has these rows:
- (100, "john.doe@company.com")
- (200, "jane.smith@company.com")
- (150, "john.doe@company.com")
What is the value of Filtered Sales?
Filtered Sales = CALCULATE(SUM(Sales[SalesAmount]), Sales[UserEmail] = USERNAME())
Think about which rows match the USERNAME() filter.
The measure sums SalesAmount only for rows where UserEmail equals the logged-in user john.doe@company.com. Those rows have amounts 100 and 150, totaling 250.
You want to create a Power BI report page that shows each logged-in user only their own sales summary using dynamic RLS with USERNAME(). Which visualization type is best to clearly show the total sales amount for the current user?
Think about a simple, clear way to show a single number filtered by RLS.
A Card visualization is best for showing a single summary number like total sales for the logged-in user. Other options show multiple users or complex visuals that are not filtered clearly by dynamic RLS.
You have a Users table with columns UserEmail and Region. Your Sales table has a Region column. You want to apply dynamic RLS so each user sees only sales from their region.
Which DAX filter expression correctly implements this dynamic RLS in the role definition?
Think about matching the sales region to the user's region found by USERNAME().
Option B filters sales rows where the region matches the region of the logged-in user found by looking up Users[Region] using USERNAME(). Other options mismatch columns or logic.
Given this RLS filter expression in Power BI:
Sales[UserEmail] = USERNAME()
Users report that after publishing, no data is visible for any user. What is the most likely cause?
Consider the format of USERNAME() output versus stored emails.
USERNAME() often returns the domain and username (e.g., domain\user), but the UserEmail column stores full email addresses (e.g., user@domain.com). This mismatch causes the filter to exclude all rows.
Your company has a hierarchy of users: regional managers and sales reps. Sales reps should see only their own sales. Regional managers should see sales for all reps in their region.
You have a Users table with UserEmail, Region, and Role columns. Sales have a SalesRepEmail and Region.
Which approach best implements dynamic RLS to meet these requirements?
Think about how to separate access by role and region using dynamic filters.
Option A correctly creates two roles: one for sales reps filtered by their own email, and one for regional managers filtered by region. This respects hierarchy and dynamic RLS principles. Other options mix filters incorrectly or rely on manual filtering.