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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MalJan19
Frequent Visitor

Strange prefix on USERNAME() and USERPRINCIPALNAME() for external users

We are working on exposing Power BI reports to external users, so I am setting up RLS on the reports using USERNAME(). When sharing with an external test email address, I discovered that Power BI tacks live.com# in front of the username, causing RLS not to work as expected. The same thing happened with one other test email address, but no prefix was added on a third test email address. The same thing happens with USERPRINCIPALNAME().

 

I have a workaround, but I still have a couple questions:

1. Is there a way to prevent the prefix from getting added on?

2. Are there any other prefixes that could appear that I need to be aware of?

 

Thanks in advance for the help!

4 REPLIES 4
Rose__123
Helper II
Helper II

Hi @MalJan19, did you solve the problem? 🙂 

/Katrine

Gabriel_Walkman
Continued Contributor
Continued Contributor

@MalJan19 my current theory is that external users without a company account will get the live# prefix, but with external users from another organization, the format is more complex. Ie. fake.ferguson@fakeorg.com would be something like fake.ferguson_fakeorg.com#EXT#@yourorg0.onmicrosoft.com.

There was an older post with a dax solution that supposedly works for both cases, but I haven't tried it yet:
https://community.powerbi.com/t5/Service/USERNAME-returning-weird-e-mail-format/td-p/545032/page/2

Greg_Deckler
Super User
Super User

Right, this is part of the just in time provisioning of external users. The prefix is where their login is coming from. Ensures uniqueness and all that. You should expect a prefix for any supported external federated login. I think outlook.com, live.com probably some others.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg. Will the email always be preceded by a #? In other words, can I build a statement into RLS that removes anything before #?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.