<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Power BI Embedded App owns data - RLS - username get in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-App-owns-data-RLS-username-get/m-p/5196570#M65216</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We are trying to embed a power bi report using App Owns Data strategy,&amp;nbsp; but we are struggling with getting the username that is viewing the report, our application already sends the identity property while obtaining the guest token, but the DAX USERNAME() and USERPRINCIPALNAME() functions return the Application Id (from entra ID) instead of the username field from the identity property.&lt;/P&gt;&lt;P&gt;Microsoft documentation advises to user USERNAME() but it is not working in our usecase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example we are obtaining Application id&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;P&gt;johnstones@myorganization.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, thanks for your help&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jun 2026 10:03:26 GMT</pubDate>
    <dc:creator>dpombal</dc:creator>
    <dc:date>2026-06-12T10:03:26Z</dc:date>
    <item>
      <title>Power BI Embedded App owns data - RLS - username get</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-App-owns-data-RLS-username-get/m-p/5196570#M65216</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;We are trying to embed a power bi report using App Owns Data strategy,&amp;nbsp; but we are struggling with getting the username that is viewing the report, our application already sends the identity property while obtaining the guest token, but the DAX USERNAME() and USERPRINCIPALNAME() functions return the Application Id (from entra ID) instead of the username field from the identity property.&lt;/P&gt;&lt;P&gt;Microsoft documentation advises to user USERNAME() but it is not working in our usecase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example we are obtaining Application id&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;instead of&lt;/P&gt;&lt;P&gt;johnstones@myorganization.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards, thanks for your help&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2026 10:03:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-App-owns-data-RLS-username-get/m-p/5196570#M65216</guid>
      <dc:creator>dpombal</dc:creator>
      <dc:date>2026-06-12T10:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded App owns data - RLS - username get</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-App-owns-data-RLS-username-get/m-p/5196613#M65217</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/22267"&gt;@dpombal&lt;/a&gt;&amp;nbsp; ,&lt;BR /&gt;Thanks for reaching out to the Microsoft Fabric Community forum.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When a report is accessed through an embedded application that authenticates with a service principal, USERPRINCIPALNAME() and USERNAME() return the service principal's application ID or an empty string not an end user's identity.&lt;/P&gt;
&lt;P&gt;These functions don’t return the end user identity and therefore can’t be used for per-user filtering in service principal embedding scenarios. This means dynamic RLS filters based on these functions won't filter data per user in embedded scenarios.&lt;/P&gt;
&lt;P&gt;To apply per-user RLS in embedded scenarios, use the effective identity feature of the Power BI REST API. Pass the EffectiveIdentity object with the appropriate username and roles when generating an embed token. If your RLS rules use CUSTOMDATA(), pass the custom data string through EffectiveIdentity.CustomData.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;For more information, Please check:&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embedded-row-level-security" target="_blank" rel="noopener"&gt;Security in Power BI embedded analytics - Power BI | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I hope this information helps. Please do let us know if you have any further queries.&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2026 11:53:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-App-owns-data-RLS-username-get/m-p/5196613#M65217</guid>
      <dc:creator>v-nmadadi-msft</dc:creator>
      <dc:date>2026-06-12T11:53:45Z</dc:date>
    </item>
  </channel>
</rss>

