Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

USERPRINCIPALNAME() and USERNAME() returns same result

Hi All,

I am facing issue with USERPRINCIPALNAMEand USERNAME both returning same result login name in my destop file.
when i publish to app.powerbi.com am seeing result as login email for both!!! 

Any one faced this issue and have any solution for it
Thanks in advance!!

3 REPLIES 3
Anonymous
Not applicable

@Anonymous 

 

In Power BI Desktop, username() returns a user in the format of DOMAIN\User and userprincipalname() returns a user in the format of username@microsoft.com

 

In Power BI Service, username() and userprincipalname() both return the userprincipalname, which is the email address format.

Best,
Paul

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly, Kudos is nice too.

Anonymous
Not applicable

Hi @Anonymous  yes thats the expected behavior, but in desktop iam getting DOMAIN\User for both the function. Not sure why this is happening in desktop, am using latest version nov 2019.

Anonymous
Not applicable

@Anonymous 

Is your account assigned to a domain? Please first check with your UPN with "whoami" in cmd.
One of my collegue also experienced the same issue, where both functions return his computer name(Desktop_xxxx\name) instead of account name. . This is because he was removed from the domain. 

Paul

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.