Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
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?
Solved! Go to Solution.
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.
@mdubose are you able to pull the username? Even I got the same scenario if you find the solution please share.
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.
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?
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.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |