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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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#[email protected]. 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 "[email protected]" which won't work. If I add msn.com#[email protected] it does.
Shoudn't the UPN() return [email protected]? 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.