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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

USERPRINCIPALNAME() with PBI Dataset as source

Using USERPRINCIPALNAME() to give users a personal view of a report.  Works great. 

 

Reorganised the report so that the source is now an online PBI dataset and now when in PBI desktop the function returns the long alphanumeric string id instead of user@xxx.com.  Still works fine in the Service but its annoying for development as I cannot test the report properley without publishing.

 

Anyone else come across this? Any workaround?

2 ACCEPTED SOLUTIONS
swise001
Continued Contributor
Continued Contributor

@Anonymous 

You can typically override the result returned by USERPRINCIPALNAME() in Power BI Desktop by selecting "Test As" from the Security section of Modelling tab - and entering any target email.

Since you are connecting to a shared dataset - these options are disabled.  Given this limitation - the only workaround may be reguarly publish the report to a test/dev PBI service environment online.  I don't believe you can override USERPRINCIPALNAME() in PBI desktop when connecting to a shared dataset.     

View solution in original post

Anonymous
Not applicable

Hi @Anonymous,

Perhaps you can add RLS role to your data model to enable the UPN instead guid id string of user names.

For detailed descriptions, you can take a look at the following blog that told about similar issues(if it helps for your scenario) :

Using Username() in DAX with Row-Level Security 
Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous,

Perhaps you can add RLS role to your data model to enable the UPN instead guid id string of user names.

For detailed descriptions, you can take a look at the following blog that told about similar issues(if it helps for your scenario) :

Using Username() in DAX with Row-Level Security 
Regards,

Xiaoxin Sheng

swise001
Continued Contributor
Continued Contributor

@Anonymous 

You can typically override the result returned by USERPRINCIPALNAME() in Power BI Desktop by selecting "Test As" from the Security section of Modelling tab - and entering any target email.

Since you are connecting to a shared dataset - these options are disabled.  Given this limitation - the only workaround may be reguarly publish the report to a test/dev PBI service environment online.  I don't believe you can override USERPRINCIPALNAME() in PBI desktop when connecting to a shared dataset.     

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors