Search code examples
javascriptpowerbipowerbi-embeddedpowerbi-datasource

How to set default page in power BI Embedded report


I'm using a power-bi Embedded report in my webpage.The report have multiple pages. I need to set the default page based on drop-down selection.Is there any query-string parameter i can use for this?

Thanks in advance.


Solution

  • There are two ways to do so with the Power BI JavaScript API.

    You can change the settings in the embed configuration object and set the default page by specifying the page name.

    var embedConfig = {
      ...
      pageName: 'ReportSection3'
    };
    

    You can also use the setPage method to set the active page of the report.

    report.setPage("page2")
     .catch(error => { ... });
    

    EDIT:

    You can also add &pageName=YourPageName to the embed URL to set the default page, i.e. https://app.powerbi.com/view?r=XXXXXXXXXXXXXXX&pageName=YourPageName