<?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 Set filters while embedding a visual in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/467738#M14376</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to set the filters on the visual while embedding it.&amp;nbsp;&lt;BR /&gt;I am getting the following error.&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.png" style="width: 405px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/107928iFD8F71C1053A9357/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there any workaround for this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The embed code:&lt;/P&gt;&lt;PRE&gt;	const filter = {
		$schema: "http://powerbi.com/product/schema#basic",
		target: {
			table: "Manufacturer",
			column: "Sample Data"
			},
		operator: "In",
		values: ["Abbas"]
	};

    var config = {
        type: 'visual',
        accessToken: accessTokenToUse,
        embedUrl: embedURLToUse,
        reportId: reportIdToUse,
        pageName: pageNameToUse,
        visualName: visualNameToUse		
     };	
    var dashboard = powerbi.embed(visualDiv, config);
	dashboard.setFilters([filter]);  &lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jul 2018 12:38:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-07-20T12:38:11Z</dc:date>
    <item>
      <title>Set filters while embedding a visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/467738#M14376</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to set the filters on the visual while embedding it.&amp;nbsp;&lt;BR /&gt;I am getting the following error.&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.png" style="width: 405px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/107928iFD8F71C1053A9357/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.png" alt="error.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there any workaround for this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The embed code:&lt;/P&gt;&lt;PRE&gt;	const filter = {
		$schema: "http://powerbi.com/product/schema#basic",
		target: {
			table: "Manufacturer",
			column: "Sample Data"
			},
		operator: "In",
		values: ["Abbas"]
	};

    var config = {
        type: 'visual',
        accessToken: accessTokenToUse,
        embedUrl: embedURLToUse,
        reportId: reportIdToUse,
        pageName: pageNameToUse,
        visualName: visualNameToUse		
     };	
    var dashboard = powerbi.embed(visualDiv, config);
	dashboard.setFilters([filter]);  &lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 12:38:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/467738#M14376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-20T12:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set filters while embedding a visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/469047#M14398</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm afraid setting filters while embedding visuals isn't available for now. Please refer to the source code of&amp;nbsp;&lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/blob/master/dist/powerbi.js#L4837" target="_self"&gt;Powerbi.js&lt;/A&gt;. I would suggest you create an idea &lt;A href="https://ideas.powerbi.com/forums/265200-power-bi-ideas?query=set%20filters%20visual" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://ibb.co/kDHSMy" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/4bde962dfd4579a1498542b5f5b8437a31377e0c/68747470733a2f2f696d6167652e6962622e636f2f697550374d792f5365745f66696c746572735f7768696c655f656d62656464696e675f615f76697375616c2e706e67" border="0" alt="Set_filters_while_embedding_a_visual" /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI'; font-size: 10.5pt; color: #333333;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: 'Segoe UI'; font-size: 10.5pt; color: #333333;"&gt;Dale&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 07:38:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/469047#M14398</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-07-23T07:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set filters while embedding a visual</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/470249#M14424</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Recently I have come across that problem as well&lt;/P&gt;&lt;P&gt;Just found a solution. It is to change object &amp;lt;filters&amp;gt; and call method &amp;lt;reload&amp;gt; of Visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/**
         * Reloads embed using existing configuration.
         * E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.
         *
         * ```javascript
         * report.reload();
         * ```
         */
        reload(): Promise&amp;lt;void&amp;gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;PRE&gt;const pbiService = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory);
const embeddedObj = &amp;lt;pbi.Visual&amp;gt;(pbiService.embed(embedContainer, embedObj.config as {}));
// will update visual using new filters from newFiltersArr after 10 seconds
setTimeout(() =&amp;gt; {
    (embeddedObj.config as any).filters = newFiltersArr;
    embeddedObj.reload();
}, 10000);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 08:25:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-filters-while-embedding-a-visual/m-p/470249#M14424</guid>
      <dc:creator>artemmuntianu</dc:creator>
      <dc:date>2018-07-24T08:25:52Z</dc:date>
    </item>
  </channel>
</rss>

