DAX function
USERPRINCIPALNAME — DAX function reference
Current user's UPN.
Syntax
dax
USERPRINCIPALNAME()
Examples
dax
Customer[Email] = USERPRINCIPALNAME()
→ An email
dax
LOOKUPVALUE(SalesRep[Region], SalesRep[Email], USERPRINCIPALNAME())
→ Looks up the logged-in user's assigned region for row-level security
A common RLS pattern that gives one admin account unrestricted access alongside per-user filtering.
dax
IF(USERPRINCIPALNAME() = "admin@contoso.com", TRUE(), Customer[RepEmail] = USERPRINCIPALNAME())
→ true / false
Common mistakes & gotchas
- The reliable identity for RLS in the Power BI Service — prefer it over USERNAME.
- USERPRINCIPALNAME() takes no arguments and returns the email/UPN of the user viewing the report in the Power BI Service — in Desktop it returns your own identity, which can make RLS testing confusing unless you use "View As Roles" to simulate other users.
- It reflects the effective identity at query time, including any identity passed through an embedding scenario — the value can differ from what USERNAME() returns in the same environment, so use whichever one matches how your RLS roles are actually written.
Related DAX functions
From Security & context info