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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RLSid17
Helper III
Helper III

USERPRINCIPALNAME() to Display Name


Hi,

I'm trying out the USERPRINCIPALNAME() function. So it displays the email address which is expected. 


I have a dataset that has two columns, Name and Email Address. But in this case, since this is a measure, I can't do a relationship.

Is there a way to convert it to the display name of the email address?

1 ACCEPTED SOLUTION
RLSid17
Helper III
Helper III

Nevermind I managed to resolve it based on this thread: Solved: How to display Username with greetings when user ... - Microsoft Power BI Community

This is the code I used to achieve my initial problem:

Display Name = 
VAR user = USERNAME()
VAR display = LOOKUPVALUE(Table1[User],Table1[Email],user)
RETURN(display)



View solution in original post

3 REPLIES 3
RLSid17
Helper III
Helper III

Nevermind I managed to resolve it based on this thread: Solved: How to display Username with greetings when user ... - Microsoft Power BI Community

This is the code I used to achieve my initial problem:

Display Name = 
VAR user = USERNAME()
VAR display = LOOKUPVALUE(Table1[User],Table1[Email],user)
RETURN(display)



onurbmiguel_
Power Participant
Power Participant

Hi RLSid17

Do you want to filter so you can only see what is associeted to the current user? 

For that you need to configure RLS  , take a look at: 

https://radacad.com/dynamic-row-level-security-with-profiles-and-users-in-power-bi

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

 

Other option is to create a calculated column where you will use the measure, it will work as as "Flag".

 

More help send a pbix with some dummy values and what do you eant as final result 

 

Best regards

Bruno Costa | Continued Contributor

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

 

wp-1586527108426

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Hi @onurbmiguel_ 

Yes, I have tried RLS and it works the only thing is that I need to be able to change the email address to display name. For example (I'm using a sample from the link you have provided):

RLSid17_0-1668792690083.png


If it detects the user, is there a way for it to be converted into "Reza Rad" instead of "reza@radacad.com"?

I have a table that has the Name and the Email Address column. Is there a way for the USERPRINCIPAL() function in which it displays the email address to look up the Name that corresponds?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.