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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

0

USERNAME(): Windows user name

Good afternoon Dear Mr.(a),

am using the DAX function USERNAME() to show the user name loged in windows.

 

I am using the following measurement:

Fulfillment =
VAR Hour = HOUR(NOW())
VAR Greeting =
SWITCH(TRUE(),
Time >= 5 && Time < 12, "Good morning",
Time >= 12 && Time < 18, "Good afternoon",
Time >= 18 && Time < 24, "Good evening",
Time >= 0 && Time < 5, "Good morning",
"Hello")

 

However, after the report was published instead of the windowns user name my email from the power bi service appears. i tried to switch to the USERPRINCIPALNAME() function but i got the same result.

 

On any machine that I open the published report, my e-mail from the power bi service appears.

how to solve it?

Status: Delivered
Comments
Anonymous
Not applicable

Hi @GuerreiroJunior 

In PBI Desktop , USERNAME() returns the machine name , USERPRINCIPALNAME() returns the Service account . But when you publish them to PBI Service , they all return the Service account . It's by design .

USERPRINCIPALNAME function (DAX) - DAX | Microsoft Learn

USERNAME function (DAX) - DAX | Microsoft Learn

 

Best Regards,
Community Support Team _ Ailsa Tao

This widget could not be displayed.