cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
mdubose
Helper I
Helper I

Return username in report instead of email address in Power BI Report Server

Hello,

I'm using the DAX function, username() in a Row-Level Security role.  In Power BI Desktop, this functions returns the username in this format: domain\user which is expected.  However, when I publish the report to Report Server, this function returns the user's email address.

 

How can I return the username in this format domain\user?  

1 ACCEPTED SOLUTION
mdubose
Helper I
Helper I

I've created a support ticket with Microsoft and they've informed me that this is an expected behavior. In that, the USERNAME() dax funtion returns UPN instead of domain\user format when report is published to Power BI Report Server.

View solution in original post

7 REPLIES 7
mdubose
Helper I
Helper I

I've created a support ticket with Microsoft and they've informed me that this is an expected behavior. In that, the USERNAME() dax funtion returns UPN instead of domain\user format when report is published to Power BI Report Server.

d_gosbell
Super User
Super User

Are you sure you are deploying to an on-prem report server?

 

As noted in the example here USERNAME - DAX Guide 

 

USERNAME() should return the name in domain\user format unless you are quering AzureAS or the Power BI Service in which case it returns the same value as USERPRINCIPALNAME() (which is an email address format)

Hi @d_gosbell , 

I'm sure I'm deploying to Report Server. See image below.  Also, authentication in through an on premise Active Directory.  Is there any setting in a config file on Report Server in which needs to be changed to make this work?

 

Screenshot.png

I'm not aware of any config setting that would change this. I've never seen this behaviour before.

 

This might be some AD configuration. When you look in the top right corner of the report portal what format is the username there? Is it domain\user or user@domain ?  You might need to open a support ticket with Microsoft to get help on this.

It displays the user's name. For example, John Doe.

freginier
Solution Specialist
Solution Specialist

What do you have using UserPrincipalName() ? 

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

 

Hi @freginier ,

With UserPrincipalName() , I also get the email address which I believe is expected. However, I do not want to return the email address of a user but their username instead.  A user's username is going against my dataset. Email address is not.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.