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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
melvin9900
Frequent Visitor

POWER BI username() Desktop

Hello,

 I am using Power Bi desktop  and in my report I need to display the Logged user details. So I used the DAX function USERNAME() to display the logged user and USERPRINCIPALNAME() to display the user email address.

During development in my desktop the USERNAME() shows my Domain name which is correct and expected.

But when I upload the report to the ON-Premise report portal both USERNAME() and USERPRINCIPALNAME() displays the email address.  The report portal is logged using the Domain name because the access to the reports are provided using the domain name so I believe the USERNAME() should display the domain name not the email address . Am I missing anything ?

Please let me know.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @melvin9900 
According to Microsoft document, as you publish your report both of these functions return the email address format.

Ritaf1983_0-1686101257449.png

For more information please follow the link:

https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @melvin9900 
According to Microsoft document, as you publish your report both of these functions return the email address format.

Ritaf1983_0-1686101257449.png

For more information please follow the link:

https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.