Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi,
i just build a rough proof of concept that works fine but might not be intended to be used this way:
The goal is to share a report to someone outside of the company/ domain. So in admin portal share with external guest users is enabled.
Next I created a report that contains a RLS = USERPRINCIPALNAME().
However USERPRINCIPALNAME() resolves some rather long/ unususal strings for foreign mail accounts like example@live.com
The function works though and the report gets filtered just fine.
Do you think it is an acceptable use of RLS and USERPRINCIPALNAME() ?
Thanks for your replies!
Solved! Go to Solution.
Hi @Dude010101
It is acceptable to use userprincipalname to build your RLS.
The Power BI DAX USERNAME() function helps to return the user domain login with the form of (Domain\User) in the locality or your local system.
The Power BI DAX USERPRINCIPALNAME() function helps to return the user principal name with the form of (User’s login credential or Preeti@<tenant>.onmicrosoft.com) in the Power BI Online Service.
For more details you may refer to these blogs:
Blog1: Row-level security (RLS) with Power BI
Blog2: Dynamic Row Level Security with Power BI Made Simple
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Dude010101
It is acceptable to use userprincipalname to build your RLS.
The Power BI DAX USERNAME() function helps to return the user domain login with the form of (Domain\User) in the locality or your local system.
The Power BI DAX USERPRINCIPALNAME() function helps to return the user principal name with the form of (User’s login credential or Preeti@<tenant>.onmicrosoft.com) in the Power BI Online Service.
For more details you may refer to these blogs:
Blog1: Row-level security (RLS) with Power BI
Blog2: Dynamic Row Level Security with Power BI Made Simple
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
What now, USERNAME() or USERPRINCIPALNAME() ?
The latter is preferred as it behaves the same on desktop and service.
Sorry, we used USERPRINCIPALNAME() in the end
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
59 | |
35 | |
27 | |
26 | |
24 |
User | Count |
---|---|
62 | |
53 | |
30 | |
23 | |
20 |