Now that Power BI Desktop supports Row-level Security (RLS), modelers have a little predicament. On the desktop, the USERNAME() function returns the user’s domain login (domain\login). However, when the model is deployed to powerbi.com, Username() returns the user principal name, which typically (but not always depending on how your AD is set up) is the user’s email address. To simplify dynamic security based on the user identity, DAX introduces a new USERPRINCIPALNAME() function that can help you secure on a column that has the user principal name. This avoids having to use an OR filter to support both deployment scenarios.
Notice that if your computer is not joined to a domain, both USERNAME() and USERPRINCIPALNAME() return the same thing (domain\login).