Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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