PL-300 · Question #339
PL-300 Question #339: Real Exam Question with Answer & Explanation
The correct answer is D: [Email Address] = USERPRINCIPALNAME(). For dynamic RLS where users only see their own data, use USERPRINCIPALNAME() to match the user's email address against the [Email Address] column.
Question
You have a Power BI data model that contains a table named Employees. The table has the following columns: - Employee Name - Email Address - Start Date - Job Title You are implementing dynamic row-level security (RLS). You need to create a table filter to meet the following requirements: - Users must see only their own employee data. - The DAX expression must work in both Power BI Desktop and the Power BI service. Which expression should you use?
Options
- A[Email Address] - USERNAME()
- B[Employee Name] - USERPRINCIPALNAME()
- C[Employee Name] = USERNAME()
- D[Email Address] = USERPRINCIPALNAME()
Explanation
For dynamic RLS where users only see their own data, use USERPRINCIPALNAME() to match the user's email address against the [Email Address] column.
Common mistakes.
- A. The hyphen (
-) is a subtraction operator, not a comparison operator, making the DAX expression invalid for filtering. - B. The hyphen (
-) is a subtraction operator, and comparing an employee name to a UPN (email address) would not result in a valid match. - C.
USERNAME()might return inconsistent values across environments and comparing[Employee Name]to a UPN (email address) is incorrect for matching.
Concept tested. Dynamic Row-Level Security (RLS) with DAX
Reference. https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls-dynamic
Community Discussion
No community discussion yet for this question.