Power BI RLS with SharePoint and Flow
Recreantly I encountered an issue when adding guest users to Power BI Row Level Security using USERPRINCIPALNAME(). After sharing the Dashboard to guest users, Power BI adds an unexpected mail# prefix in front of the email, causing RLS to not work.
Since my RLS is controlled by business users in SharePoint, I created a simple solution to retrieve UPNs for guest users using SharePoint and Power Automate. This approach works for the 'normal' case with EXIT# and other prefix scenarios (mail# in my case).
Power Automate Flow:
In the step "SharePoint Status changes to pending" :
Power Automate will fill the User Principal Name and the "Alternate UPN" fields for me to use in Power BI.
Add an extra row in DAX and it works perfectly :)