pbPassingBI
/

What is the difference between USERNAME() and USERPRINCIPALNAME()?

intermediate
Answer

USERPRINCIPALNAME() returns the user principal name, usually their email address, and behaves consistently in both Power BI Desktop and the Service.

USERNAME() returns a domain\\user format in Desktop but the UPN in the Service, so a role built on it can behave differently after publishing.

For dynamic RLS, use USERPRINCIPALNAME().

Related