Forum Discussion
USERPRINCIPALNAME is blank for External Customer
I have a report using RLS for my external customers. Sometimes we run into problems with the RLS and so we have a tab that simply displays their USERPRINCIPALNAME, as that can be useful in diagnosing the problem.
We have a new user who's having RLS issues, but when they go to the tab, the card graphic that displays their USERPRINCIPALNAME is blank. I've screen shared with them, seen them log in to our system, even had them do it after rebooting and in a different browser. USERPRINCIPALNAME remains blank. And since the card displays like this:
But for this user it displays completely blank (not even the "userPrincipalName" label underneath).
Any ideas what I can try?
Turns out the issue was I'd accidentally added RLS to the troubleshooting report by mistake. Removed that and re-published, and now everything is working. Thanks all.
4 Replies
- Shahid12523Community Champion
- Blank USERPRINCIPALNAME() usually means the user isn’t properly authenticated.
- Make sure they’re accessing the report via Power BI Service, not an embedded or anonymous link.
- Confirm they’ve been added as a Guest user in Azure AD and accepted the invite.
- Try disabling RLS temporarily to see if it’s filtering them out.
- Use a raw measure like ShowUPN = USERPRINCIPALNAME() with no conditions. - GabrySuper User
Hello,
To narrow this down, please check the following:
-
How is the card built, does it display a column or a measure? What fields are inside the visual?
-
Are there any additional filters on the visual?
-
Could RLS be affecting this visual for your role?
If you haven’t already, create a new blank page and add only a card with the measure USERPRINCIPALENAME to verify which identity the model sees.
-
- v-sshirivoluCommunity Support
Hi c_lovestrom ,
Thank you for providing the details. This behavior is expected in certain scenarios with B2B guest users, as the USERPRINCIPALNAME() function may return a blank value when a UPN claim is not provided by some external identities.You may consider the following alternatives:
Utilize USEROBJECTID() for RLS mapping, which offers greater reliability for both internal and external users.
Alternatively, implement a fallback expression such as:
Identifier =
IF(
ISBLANK(USERPRINCIPALNAME()),
USERNAME(),
USERPRINCIPALNAME()
)This approach ensures that if the UPN is unavailable, the system will default to the username or email. Additionally, please confirm that the external guest has fully accepted the Azure AD invitation and is signing in with their work account, as an incomplete setup may also result in a blank UPN.
- c_lovestromFrequent Visitor
Turns out the issue was I'd accidentally added RLS to the troubleshooting report by mistake. Removed that and re-published, and now everything is working. Thanks all.