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
dirkmuis
Helper II
Helper II

UPN function not working correctly

If I'm user the USERPRINCIPALNAME() on a gmail account I do get the msn.com# returned which should be part of the USERNAME() function. Is this a known issue or is the function broken?

With another domain (outside organisation) the UPN() works perfect.

9 REPLIES 9
GilbertQ
Super User
Super User

Hi there

I have found that even though that is displayed from the picker, if you are using RLS it will still use the actual email address




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

I tried with an @gmail.com and with an @somethingelse.com.

The @somethingelse.com does return the e-mail adress. 

The @gmail.com does return the UN() so e.g. msn.com#test@gmail.com. I've no idea where the MSN part is coming from? That must be because the gmail has been registered at microsoft for using with powerBI.

@dirkmuis ,

 

Yes, the external email account will be changed temporarily. You can ignore them when you build dynamic RLS, creating a column using original gmail can work well.

 

Community Support Team _ Jimmy Tao

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

I don't understand.

My DAX looks like this:

 

[ID beroepsgroep] IN SELECTCOLUMNS(
FILTER(
'tblBIuserprofgroup',
RELATED(tblBIUser[tblBIUsername])=USERPRINCIPALNAME()
),"tblprofgroupid"
,[tblprofgroupid]
)

 The user table contains in tblBIUsername the value "test@gmail.com" which won't work. If I add msn.com#test@gmail.com it does.
Shoudn't the UPN() return test@gmail.com? And how will I know how everyone's gmail adres will be formatted like?

I do the same as you for gmail addresses




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

I still need to put msn.com# in front

That is correct yes





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

So how do I know which will be the part in front as it is not always msn.com#........

From what I have seen if the email address is to a @hotmail @outlook.com @live.com or @Gmail.com then the above will be put in the front.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.