<?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: Filter Chart using JavaScript API in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/102167#M3551</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang﻿&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able to get it work with PowerBI Embedded.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2016 08:51:13 GMT</pubDate>
    <dc:creator>skancharla</dc:creator>
    <dc:date>2016-12-14T08:51:13Z</dc:date>
    <item>
      <title>Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/93651#M3314</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a created a chart from desktop and integrated to our application .Now I'm trying to filter the chart with JavaScript API filters using this &lt;A title="Filters" href="https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters" target="_blank"&gt;reference&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Downloaded the required power bi models from npm version and included the .js , .ts files. But still seeing error that pbi/models/IBasic filter is not defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried both the below ways of constructing filters but no luck. I see that for the models ,typescripting is used to which I'm new.&lt;/P&gt;&lt;P&gt;Any Help or direction to resolve this would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="pl-k"&gt;const&lt;/SPAN&gt; advancedFilter &lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;new&lt;/SPAN&gt; &lt;SPAN class="pl-en"&gt;pbi&lt;/SPAN&gt;.&lt;SPAN class="pl-en"&gt;models&lt;/SPAN&gt;.&lt;SPAN class="pl-en"&gt;AdvancedFilter&lt;/SPAN&gt;({&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="pl-k"&gt;const&lt;/SPAN&gt; basicFilter&lt;SPAN class="pl-k"&gt;:&lt;/SPAN&gt; &lt;SPAN class="pl-en"&gt;pbi&lt;/SPAN&gt;.&lt;SPAN class="pl-en"&gt;models&lt;/SPAN&gt;.&lt;SPAN class="pl-en"&gt;IBasicFilter&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt; {
  $schema: &lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;http://powerbi.com/product/schema#basic&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
  target: {
    table: &lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;Store&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
    column: &lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;Count&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
  },
  operator: &lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;In&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
  values: [&lt;SPAN class="pl-c1"&gt;1&lt;/SPAN&gt;,&lt;SPAN class="pl-c1"&gt;2&lt;/SPAN&gt;,&lt;SPAN class="pl-c1"&gt;3&lt;/SPAN&gt;,&lt;SPAN class="pl-c1"&gt;4&lt;/SPAN&gt;]
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2016 09:36:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/93651#M3314</guid>
      <dc:creator>skancharla</dc:creator>
      <dc:date>2016-11-24T09:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/94667#M3339</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17378"&gt;@skancharla﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you've add the script reference in the html page.&lt;/P&gt;
&lt;PRE&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;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Also you can try below sample, which actually works in my test.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt; var  &lt;STRONG&gt;Filter&lt;/STRONG&gt; = {
   $schema: "http://powerbi.com/product/schema#advanced",
  target: {
    table: "Sales CountryRegionCurrency",
    column: "CountryRegionCode"
  },
  logicalOperator: "OR",
  conditions: [
    {
      operator: "Contains",
      value: "CN"
    },
    {
      operator: "Contains",
      value: "CO"
    }
  ]
}
 

var embedConfiguration = {
    type: 'report',
    accessToken: 'xxxxx',
    id: '94da70b0xxxxxx-86bb8a2b9c18',
    embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed?reportId=94da70bxxxxxx8a2b9c18',

}; 
 

var $reportContainer = $('#reportContainer');
 
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

&amp;lt;!--validateReportLoad incorrectly returns schema errors for valid filters #16https://github.com/Microsoft/powerbi-models/issues/16--&amp;gt;

report.on('loaded', event =&amp;gt; {
  report.getFilters()
    .then(filters =&amp;gt; {
      filters.push(&lt;STRONG&gt;Filter&lt;/STRONG&gt;);
      return report.setFilters(filters);
    });
});
&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Nov 2016 09:07:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/94667#M3339</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-11-28T09:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/97552#M3429</link>
      <description>&lt;P&gt;&lt;SPAN class="name"&gt;Thanks &amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang﻿&lt;/a&gt;. I'm able to fix the filter undefined error .But still filter is not getting applied.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="name"&gt;Receiving below error in the console when setFilter is called.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="name"&gt;Uncaught (in promise) &amp;nbsp;Message&lt;/SPAN&gt;&lt;SPAN class="object-properties-section-separator"&gt;:&lt;/SPAN&gt;&lt;SPAN class="value object-value-string"&gt;"This feature is not supported for Publish To Web."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="value object-value-string"&gt;Is it anything to do with the way the report is published.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 08:57:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/97552#M3429</guid>
      <dc:creator>skancharla</dc:creator>
      <dc:date>2016-12-05T08:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/97560#M3430</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17378"&gt;@skancharla﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought you'were embedding the report via Power BI REST API. If via "Publish to web", then it may, as the message indicats, not be supported. Try&amp;nbsp;&lt;SPAN&gt;via Power BI REST API instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 09:08:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/97560#M3430</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-12-05T09:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/102167#M3551</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang﻿&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able to get it work with PowerBI Embedded.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 08:51:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/102167#M3551</guid>
      <dc:creator>skancharla</dc:creator>
      <dc:date>2016-12-14T08:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/520705#M16073</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code and it is not working,&amp;nbsp; any suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var report = powerbi.embed(reportContainer, config);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var filter = {&lt;BR /&gt;$schema: "&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;",&lt;BR /&gt;target: {&lt;BR /&gt;table: "customers",&lt;BR /&gt;column: "CustomerID"&lt;BR /&gt;},&lt;BR /&gt;operator: "Is",&lt;BR /&gt;values: "1234" //,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//report.removeFilters();&lt;BR /&gt;report.setFilters([filter]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thansk heaps..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 06:21:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/520705#M16073</guid>
      <dc:creator>ggww</dc:creator>
      <dc:date>2018-09-20T06:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Chart using JavaScript API</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/520707#M16074</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code and it is not working,&amp;nbsp; any suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var report = powerbi.embed(reportContainer, config);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var filter = {&lt;BR /&gt;$schema: "&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;",&lt;BR /&gt;target: {&lt;BR /&gt;table: "customers",&lt;BR /&gt;column: "CustomerID"&lt;BR /&gt;},&lt;BR /&gt;operator: "Is",&lt;BR /&gt;values: "1234" //,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//report.removeFilters();&lt;BR /&gt;report.setFilters([filter]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thansk heaps..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 06:22:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Filter-Chart-using-JavaScript-API/m-p/520707#M16074</guid>
      <dc:creator>ggww</dc:creator>
      <dc:date>2018-09-20T06:22:38Z</dc:date>
    </item>
  </channel>
</rss>

