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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Siboska
Helper II
Helper II

Row-Level-Security for External Azure users

Hi,

I have a challenge regarding how to set up row-level security for people outside our organization who have been invited as Azure guest users.

My Row Level Security User table in Power BI is in the following format:

NameEmailDepartment
John[email protected]Production

 

Then I used the standard approach where a role called "department access" has been added:

 

Email = PrincipleName()

 

 

I read Microsoft's documentation, and it seems that the PrincipalName() should be returned in the email format when a user is logging in:
"[email protected]"

But, when I test the role in Power BI service the users PrincipleName() is returned in the external organisation format:

John_CustomDomain.com#[email protected].

 

To my knowledge, this will break the row-level security.

 

I have thought of two solutions:

 

Solution 1: Fix it in my DAX security role logic:

 

[Medarbejder Email] = 
IF(
    CONTAINSSTRING(USERPRINCIPALNAME(), "#EXT#"),
    SUBSTITUTE(LEFT(USERPRINCIPALNAME(), SEARCH("#EXT#", USERPRINCIPALNAME(), 1) - 1), "_", "@"),
    USERPRINCIPALNAME()
)

 

This should ensure that the extracted Principle name can be used to match the Email in my RLS table.

 


Solution 2: Add all the PrincipalNames manually to my User Row Level table in Power BI.

 

 

I am looking for some advice or experiences on this challenge.

 

1 ACCEPTED SOLUTION
Siboska
Helper II
Helper II

Update:

When one of the users tested the report, it returned his actual email.
I guess the answer is that it isn’t possible to test an external user's PrincipalName.

I will close the ticket.

View solution in original post

1 REPLY 1
Siboska
Helper II
Helper II

Update:

When one of the users tested the report, it returned his actual email.
I guess the answer is that it isn’t possible to test an external user's PrincipalName.

I will close the ticket.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors