<?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 In Built Report Usage Metrics causing issue when trying embed an RLS enabled report in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2920871#M39879</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**same post as in the service forum as I am not sure where the question sits best.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are having a challenge with embedded while using RLS, the inbuilt "Report Usage Metrics" dataset seems to be causing an error because RLS is not enable in it. Has any else eperience this issue amd found a resolution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richanthony_0-1669104947702.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/827497iBCC4D9B63A402203/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richanthony_0-1669104947702.png" alt="richanthony_0-1669104947702.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 08:15:59 GMT</pubDate>
    <dc:creator>richanthony</dc:creator>
    <dc:date>2022-11-22T08:15:59Z</dc:date>
    <item>
      <title>In Built Report Usage Metrics causing issue when trying embed an RLS enabled report</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2920871#M39879</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**same post as in the service forum as I am not sure where the question sits best.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are having a challenge with embedded while using RLS, the inbuilt "Report Usage Metrics" dataset seems to be causing an error because RLS is not enable in it. Has any else eperience this issue amd found a resolution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richanthony_0-1669104947702.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/827497iBCC4D9B63A402203/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richanthony_0-1669104947702.png" alt="richanthony_0-1669104947702.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 08:15:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2920871#M39879</guid>
      <dc:creator>richanthony</dc:creator>
      <dc:date>2022-11-22T08:15:59Z</dc:date>
    </item>
    <item>
      <title>In Built Report Usage Metrics causing issue when trying embed an RLS enabled report</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2920856#M39908</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are having a challenge with embedded while using RLS, the inbuilt "Report Usage Metrics" dataset seems to be causing an error because RLS is not enable in it. Has any else eperience this issue amd found a resolution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="richanthony_0-1669104299369.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/827488i035D454639541ED3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="richanthony_0-1669104299369.png" alt="richanthony_0-1669104299369.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 08:08:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2920856#M39908</guid>
      <dc:creator>richanthony</dc:creator>
      <dc:date>2022-11-22T08:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: In Built Report Usage Metrics causing issue when trying embed an RLS enabled report</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2923892#M39912</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/137124"&gt;@richanthony&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may try below code to generate embed token.&amp;nbsp;&lt;SPAN&gt;The report will filter data according to the RLS applied.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;public EmbedToken GetEmbedToken(Guid reportId, IList&amp;lt;Guid&amp;gt; datasetIds, [Optional] Guid targetWorkspaceId)
    {
        PowerBIClient pbiClient = this.GetPowerBIClient();

       // Defines the user identity and roles.
        var rlsIdentity = new EffectiveIdentity(
            username: "France",
            roles: new List&amp;lt;string&amp;gt;{ "CountryDynamic" },
            datasets: new List&amp;lt;string&amp;gt;{ datasetId.ToString()}
        );
       
        // Create a request for getting an embed token for the rls identity defined above
        var tokenRequest = new GenerateTokenRequestV2(
            reports: new List&amp;lt;GenerateTokenRequestV2Report&amp;gt;() { new GenerateTokenRequestV2Report(reportId) },
            datasets: datasetIds.Select(datasetId =&amp;gt; new GenerateTokenRequestV2Dataset(datasetId.ToString())).ToList(),
            targetWorkspaces: targetWorkspaceId != Guid.Empty ? new List&amp;lt;GenerateTokenRequestV2TargetWorkspace&amp;gt;() { new GenerateTokenRequestV2TargetWorkspace(targetWorkspaceId) } : null,
            identities: new List&amp;lt;EffectiveIdentity&amp;gt; { rlsIdentity }
        );

        // Generate an embed token
        var embedToken = pbiClient.EmbedToken.GenerateToken(tokenRequest);

        return embedToken;
    }&lt;/LI-CODE&gt;
&lt;P&gt;Here I suggest you to refer to this offical blog to learn more details about RLS in Power BI Embed.&lt;/P&gt;
&lt;P&gt;For reference:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/cloud-rls" target="_self"&gt;Embed a report with cloud-based RLS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 09:07:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2923892#M39912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-23T09:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: In Built Report Usage Metrics causing issue when trying embed an RLS enabled report</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2924051#M39914</link>
      <description>&lt;P&gt;Thanks for taking the time to reply, In this instance it is the "hidden"&amp;nbsp;&lt;SPAN&gt;Report Usage Metrics dataset that does not have RLS configured that is causing the problem. However from what you have said it looks like you can specify the dataset not just the workspace you want to configure so I will give that ago.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 10:02:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/In-Built-Report-Usage-Metrics-causing-issue-when-trying-embed-an/m-p/2924051#M39914</guid>
      <dc:creator>richanthony</dc:creator>
      <dc:date>2022-11-23T10:02:14Z</dc:date>
    </item>
  </channel>
</rss>

