<?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: Exporting pre-built dashboards for users in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Exporting-pre-built-dashboards-for-users/m-p/452473#M13896</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/70362"&gt;@rodolfodonahosp&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the end users can operate the slicers and the filters, you can just show them the reports and dashboards. If you want the filter change automatically, I think you can do some coding. Please refer to the &lt;A href="https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html" target="_self"&gt;live demo&lt;/A&gt;. You also can download the code from &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript" target="_self"&gt;here&lt;/A&gt;. You can use the setFilters function.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;function _Page_SetFilters() {
    // Get a reference to the embedded report HTML element
    var embedContainer = $('#embedContainer')[0];

    // Get a reference to the embedded report.
    report = powerbi.get(embedContainer);

    // Build the filter you want to use. For more information, see Constructing
    // Filters in https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters.
    const filter = {
        $schema: "http://powerbi.com/product/schema#basic",
        target: {
            table: "Store",
            column: "Chain"
        },
        operator: "In",
        values: ["Lindseys"]
    };

    // Retrieve the page collection and then set the filters for the first page.
    // Pay attention that setFilters receives an array.
    report.getPages()
        .then(function (pages) {
          // Retrieve active page.
          var activePage = pages.find(function(page) {
            return page.isActive
          });

          activePage.setFilters([filter])
            .catch(function (errors) {
                Log.log(errors);
            });
        })
        .catch(function (errors) {
            Log.log(errors);
        });
}
&lt;/PRE&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, 02 Jul 2018 09:10:07 GMT</pubDate>
    <dc:creator>v-jiascu-msft</dc:creator>
    <dc:date>2018-07-02T09:10:07Z</dc:date>
    <item>
      <title>Exporting pre-built dashboards for users</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Exporting-pre-built-dashboards-for-users/m-p/451661#M13873</link>
      <description>&lt;P&gt;Hello! I am a developer and i stumbled across Power BI and loved its featuresso i am thinking of apllying it's feature to show some BI for the users. What i intend to do is build a report showing some fixed information on a report, and display this pre-build report for the user changing only some filters, like the date. Is there a way on Power BI to do this without the need of the user manually create the reports, some automatic way to change the filters and display the report (because some of the users barely know the basics of a computer)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 19:58:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Exporting-pre-built-dashboards-for-users/m-p/451661#M13873</guid>
      <dc:creator>rodolfodonahosp</dc:creator>
      <dc:date>2018-06-29T19:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting pre-built dashboards for users</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Exporting-pre-built-dashboards-for-users/m-p/452473#M13896</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/70362"&gt;@rodolfodonahosp&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the end users can operate the slicers and the filters, you can just show them the reports and dashboards. If you want the filter change automatically, I think you can do some coding. Please refer to the &lt;A href="https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html" target="_self"&gt;live demo&lt;/A&gt;. You also can download the code from &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript" target="_self"&gt;here&lt;/A&gt;. You can use the setFilters function.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;function _Page_SetFilters() {
    // Get a reference to the embedded report HTML element
    var embedContainer = $('#embedContainer')[0];

    // Get a reference to the embedded report.
    report = powerbi.get(embedContainer);

    // Build the filter you want to use. For more information, see Constructing
    // Filters in https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters.
    const filter = {
        $schema: "http://powerbi.com/product/schema#basic",
        target: {
            table: "Store",
            column: "Chain"
        },
        operator: "In",
        values: ["Lindseys"]
    };

    // Retrieve the page collection and then set the filters for the first page.
    // Pay attention that setFilters receives an array.
    report.getPages()
        .then(function (pages) {
          // Retrieve active page.
          var activePage = pages.find(function(page) {
            return page.isActive
          });

          activePage.setFilters([filter])
            .catch(function (errors) {
                Log.log(errors);
            });
        })
        .catch(function (errors) {
            Log.log(errors);
        });
}
&lt;/PRE&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, 02 Jul 2018 09:10:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Exporting-pre-built-dashboards-for-users/m-p/452473#M13896</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2018-07-02T09:10:07Z</dc:date>
    </item>
  </channel>
</rss>

