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.

Reply
P3Sven
Helper I
Helper I

Row Level Security | Userprincipalname() for Guest Account

Hi lovely community,

 

I've a Report with RLS Group invited "All Users" cause I've a dynamic RLS Table saved in Dataverse with all Users should able to see RLS content.

 

RLS Filter in Power BI: [Email] = USERPRINCIPALNAME()

 

Works fine for the most Guest Accounts, but we have some Users with "mail#max.mustermann@company.com" instead of "max.mustermann@company.com" as Userprincipalname().  Don't know why there's a prefix of "mail#".

So I just created a new column with "mail#" + Email in our RLS Table for the "right" Userprincipalname.

 

New RLS Filter in Power BI: [Email] = USERPRINCIPALNAME() || [Custom Email] = USERPRINCIPALNAME()

 

But also with this its not working.

So I guess its not cause the Guest Account is not a part of "All Users". I also use "All Users" for Report Access and this is working.

 

So why RLS is not working with the Custom Mail and why there are Guest Accounts with "mail#" ?

 

BR,

Sven

1 ACCEPTED SOLUTION

Have found my fail, just had wrong RLS Formula. "Userprincipalname()" instead of Userprincipalname() 😕

 

Anyway it's hard to understand where the "right" Userprincipalname() in Dataverse is saved or whether theres another name not saved in Dataverse.

View solution in original post

6 REPLIES 6
v-robertq-msft
Community Support
Community Support

Hi, 

According to your requirement, I think you can refer to this blog and check if it can be helpful:

https://superfarb.com/power-bi-row-level-security-while-sharing-with-external-users/

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

GilbertQ
Super User
Super User

Hi @P3Sven 

 

That should then work as expected, not sure why this is happening!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

GilbertQ
Super User
Super User

Hi @P3Sven 


What I have done in the past is to have both versions of the email/UPN in the RLS that way which ever one gets passed still works?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ ,

 

I've created RLS Role with 3 options out of systemuser dataverse table:

- dominname (normaly = USERPRINCIPALNAME(), but for Guest Account something with #EXT)

- internalemail (just the normal emailadress)

- custom mail (Custom added column with mail# + email, cause its not in systemuser dataverse table available, but is showing in Power BI as USERPRINCIPALNAME())

 

Unfortunately my custom email column is not working although USERPRINCIPALNAME () is showing exactly the same and should be filtered in RLS.

 

BR,

Sven

Have found my fail, just had wrong RLS Formula. "Userprincipalname()" instead of Userprincipalname() 😕

 

Anyway it's hard to understand where the "right" Userprincipalname() in Dataverse is saved or whether theres another name not saved in Dataverse.

Hi, 

Glad to hear that you have solved your problem by yourself, would you like to mark your own reply as a solution so that others can learn from it too?

Thanks in advance!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors