<?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 Re: Row Level Security in Power BI Embedded problems. in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/137981#M4763</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8941"&gt;@joemensor&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are facing the same issue. Is there any way to ged rid of the&amp;nbsp;&lt;SPAN&gt;COALESCE in the dynamic query? We found that&amp;nbsp;COALESCE is not used when the report is opened from Power BI desktop and its used only through Power BI Embedded. Any help regarding this is highly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 13:28:38 GMT</pubDate>
    <dc:creator>chakravarthi_l</dc:creator>
    <dc:date>2017-03-07T13:28:38Z</dc:date>
    <item>
      <title>Row Level Security in Power BI Embedded problems.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59589#M1909</link>
      <description>&lt;P&gt;I am using RLS in power bi embedded on a database using directquery which seems to be extremely slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have tracked this down to the underlying dynamic SQL that is generated, it is using the COALESCE function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(COALESCE([t4].[projectID], 0) = 49)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I execute the SQL in query analyzer as expected the query is very slow, however when I modify the line with coalesce to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;([t4].[projectID] = 49)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the query executes within seconds.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why is this the case? Obviously I have very little way of influencing the dynamic SQL that is generated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 15:20:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59589#M1909</guid>
      <dc:creator>joemensor</dc:creator>
      <dc:date>2016-08-17T15:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Row Level Security in Power BI Embedded problems.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59818#M1914</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8941"&gt;@joemensor﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the performance difference, most probably there's an index on the [projectid] and the COALESCE&amp;nbsp;function prevents the query using the index. How is the RLS set in your case, does it has anything to do with the [projectid]?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know, there's no way to&amp;nbsp;influence the dynamic SQL generation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the DirectQuery Mode, did you enable the option "&lt;A href="https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-use-directquery/" target="_self"&gt;Allow unrestricted measures&lt;/A&gt;"? It&amp;nbsp;would definitely affect the performance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way,&amp;nbsp;I've also&amp;nbsp;observed many in-efficient dynamic SQL in other cases. You can submit&amp;nbsp;your feedback on &lt;A href="http://ideas.powerbi.com" target="_self"&gt;Power BI Ideas&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 06:36:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59818#M1914</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-08-18T06:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Row Level Security in Power BI Embedded problems.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59830#M1916</link>
      <description>&lt;P&gt;Thanks for the reply Eric!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the RLS we've simply used the DAX expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ProjectID] = 49&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although when publishing this to Power BI Embedded we actually change it to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ProjectID]=USERNAME()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Allow unrestricted measures' is enabled.&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>Thu, 18 Aug 2016 07:13:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59830#M1916</guid>
      <dc:creator>joemensor</dc:creator>
      <dc:date>2016-08-18T07:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Row Level Security in Power BI Embedded problems.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59858#M1917</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8941"&gt;@joemensor﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the clarification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on my research, the dynamic query would always use COALESCE regardless of the "Allow unrestricted measures" option.&amp;nbsp; As to DirectQuery mode in Power BI Embeded, then I think you're using a Azure database? So far I can't think of any workaround to bypass the performance issue. Maybe you can try to upgrade Azure database to a higher service tier or use import mode instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please submit an feedback on &lt;A href="http://ideas.powerbi.com" target="_self"&gt;Power BI Ideas&lt;/A&gt;. Meanwhile I will report this internally and post back if there comes any update.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 08:03:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/59858#M1917</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-08-18T08:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Row Level Security in Power BI Embedded problems.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/137981#M4763</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/8941"&gt;@joemensor&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are facing the same issue. Is there any way to ged rid of the&amp;nbsp;&lt;SPAN&gt;COALESCE in the dynamic query? We found that&amp;nbsp;COALESCE is not used when the report is opened from Power BI desktop and its used only through Power BI Embedded. Any help regarding this is highly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 13:28:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Row-Level-Security-in-Power-BI-Embedded-problems/m-p/137981#M4763</guid>
      <dc:creator>chakravarthi_l</dc:creator>
      <dc:date>2017-03-07T13:28:38Z</dc:date>
    </item>
  </channel>
</rss>

