<?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 - Filtering dataset based on an array (WHERE clause) in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Filtering-dataset-based-on-an-array-WHERE/m-p/133620#M4612</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a need to display a report containing data (using DirectQuery). &amp;nbsp;My datasource is a SQL view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for me to pass a parameter(s) to a WHERE clause when rendering my report so that my dataset will only be limited to specific rows?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example if my SQL view looked like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/463ab920417620a7c15503cf089a14a2c17678dc/687474703a2f2f696d6775722e636f6d2f6b4b616545796e2e706e67" border="0" alt="" width="198" height="122" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I only wanted my data set to contain rows with a RecordId of 346, 123 and 458, is it possible for me to do this? &amp;nbsp;This has to be dynamic because&amp;nbsp;when rendering the same report elsewhere I'd perhaps only want to show records 328 and 995.&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>Mon, 27 Feb 2017 13:39:52 GMT</pubDate>
    <dc:creator>MarkWalsh</dc:creator>
    <dc:date>2017-02-27T13:39:52Z</dc:date>
    <item>
      <title>Power BI Embedded - Filtering dataset based on an array (WHERE clause)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Filtering-dataset-based-on-an-array-WHERE/m-p/133620#M4612</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a need to display a report containing data (using DirectQuery). &amp;nbsp;My datasource is a SQL view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for me to pass a parameter(s) to a WHERE clause when rendering my report so that my dataset will only be limited to specific rows?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example if my SQL view looked like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/463ab920417620a7c15503cf089a14a2c17678dc/687474703a2f2f696d6775722e636f6d2f6b4b616545796e2e706e67" border="0" alt="" width="198" height="122" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I only wanted my data set to contain rows with a RecordId of 346, 123 and 458, is it possible for me to do this? &amp;nbsp;This has to be dynamic because&amp;nbsp;when rendering the same report elsewhere I'd perhaps only want to show records 328 and 995.&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>Mon, 27 Feb 2017 13:39:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Filtering-dataset-based-on-an-array-WHERE/m-p/133620#M4612</guid>
      <dc:creator>MarkWalsh</dc:creator>
      <dc:date>2017-02-27T13:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Embedded - Filtering dataset based on an array (WHERE clause)</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Filtering-dataset-based-on-an-array-WHERE/m-p/134061#M4622</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/22437"&gt;@MarkWalsh&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You can try to &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details" target="_self"&gt;use filter when embedding&lt;/A&gt;&amp;nbsp;in the Javascript API. Check the &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters" target="_self"&gt;wiki&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;const basicFilter: pbi.models.IBasicFilter = {
  $schema: "http://powerbi.com/product/schema#basic",
  target: {
    table: "Store",
    column: "Count"
  },
  operator: "In",
  values: [1,2,3,4]
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A quick demo for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;html&amp;gt;

 &amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/powerbi-client/dist/powerbi.js"&amp;gt;&amp;lt;/script&amp;gt;
 
 &amp;lt;script src="https://microsoft.github.io/PowerBI-JavaScript/demo/bower_components/jquery/dist/jquery.js"&amp;gt;&amp;lt;/script&amp;gt;  
 
&amp;lt;script type="text/javascript"&amp;gt;
window.onload = function () { 
  var  IamAFilter = {
        $schema: "http://powerbi.com/product/schema#basic",
  target: {
    table: "Questions",
    column: "site"
  },
  operator: "In",
  values: ["stackoverflow"]
}
 

var embedConfiguration = {
    type: 'report',
    accessToken: 'YOUR TOKEN HERE',
    id: 'b7441d21XXXXXXXc5bd6426d',
    embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=b7441d21-XXXXXXXX7c5bd6426d',
	filters:[IamAFilter], // the filters is an array here, you can add more filter like [filter1,filter2,filter3]
	settings: {
        filterPaneEnabled: true //hide the filterPane so that your user can't change the filter to see more data, this is not a strong security, anyone who's familar with javascript can bypass it
    }

}; 
 

var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration); 


}
&amp;lt;/script&amp;gt;

&amp;lt;div id="reportContainer" powerbi-settings-nav-content-pane-enabled="true"   powerbi-settings-filter-pane-enabled="true"&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, it is not a good idea to use the filter to stop people seeing data, for security, I'd suggest you use &lt;A href="https://docs.microsoft.com/en-us/azure/power-bi-embedded/power-bi-embedded-rls" target="_self"&gt;RLS in Power BI Embedded&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 06:17:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Embedded-Filtering-dataset-based-on-an-array-WHERE/m-p/134061#M4622</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-02-28T06:17:57Z</dc:date>
    </item>
  </channel>
</rss>

