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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Power Bi

In the official documentation for RLS it says:

 

Within the Power BI service, username() and userprincipalname() will both return the user's User Principal Name (UPN). This looks similar to an email address.

 

This does not seem to be the case. In service both username() and userprincipalname() seem to return a user's email address, rather than their User Principal Name.

There are a couple of other oddities/bugs. The Preview a report as a role/specific person in the Security section of a dataset in Power Bi Service interprets UPN in the desktop manner as compared to what Power Bi Service will actually show a user (email address).

A smaller point is that Power Bi service shows the UPN to be different things in different areas. When reviewing the list of users with access to a workspace hovering over the information icon of a user shows the UPN to be their email address. If you view the UPN of the same user in the RLS Preview section of a report the UPN it is shown as their actual UPN.

Status: Investigating

Hi @rjhartop ,

 

In Power BI Desktop, will return and will return username()domain/usernameuserprincipalname()username@domain.com.
However, in Power BI Service, both and will return username()userprincipalname()username@domain.com. This is similar to an email format.
It’s also noted that in Import mode, both and return the user’s User Principal Name (UPN), which is similar to an email address. username()userprincipalname()In Direct Query mode, returns a user in the format of and returns a user in the format of username()DOMAIN\\Useruserprincipalname()user@contoso.com.
The discrepancies you’re seeing in different areas of Power BI Service might be due to how these functions interpret the UPN in different contexts. It seems like there might be some inconsistencies in how Power BI Service displays the UPN. It‘s by design.

 

Best regards.
Community Support Team_Caitlyn

Comments
v-xiaoyan-msft
Community Support
Status changed to: Investigating

Hi @rjhartop ,

 

In Power BI Desktop, will return and will return username()domain/usernameuserprincipalname()username@domain.com.
However, in Power BI Service, both and will return username()userprincipalname()username@domain.com. This is similar to an email format.
It’s also noted that in Import mode, both and return the user’s User Principal Name (UPN), which is similar to an email address. username()userprincipalname()In Direct Query mode, returns a user in the format of and returns a user in the format of username()DOMAIN\\Useruserprincipalname()user@contoso.com.
The discrepancies you’re seeing in different areas of Power BI Service might be due to how these functions interpret the UPN in different contexts. It seems like there might be some inconsistencies in how Power BI Service displays the UPN. It‘s by design.

 

Best regards.
Community Support Team_Caitlyn

rjhartop
Helper II

Thanks for your message. It is difficult to read. This is how it is formatted on my computer.

rjhartop_0-1697185280974.png

I am happy to demo the discrepenacies over a call.

Why would there be discrepancies by design in how a UPN is displayed?