Introducing the new Power BI JavaScript API
Today we are excited to announce the release of our new JavaScript API, which provides bidirectional communication between Power BI reports and your application. The JavaScript API enables you to more easily embed reports into your applications and to programmatically interact with those reports so that the applications and the reports are more integrated. Two of the key features to call out with today's release are: much more advanced filtering of reports, and control over page navigation.
With this new functionality your application can open reports with the correct context for your users, as well as change that context after the report has already been loaded. For example, you could open a report to a specific customer and change that customer automatically as the user interacts with other parts of your application.
How does embedding with Power BI work?
To best understand the benefits of the Power BI JavaScript API, let’s examine how embedding in Power BI currently works. Embedding a Power BI report in your application is done with an iframe, which is hosted as part of the app. The iframe acts as a boundary between your application and the Power BI report. With no way to pass infromation through the iframe, the report cannot interact with your application and your application can’t interact with the report. While the iframe can make the embedding process a lot easier, this lack of interaction between your application and the Power BI report can sometimes make it feel like the report is not really part of your application.
Now the new Power BI JavaScript API will allow you to write code that can securely pass through the iframe boundary, so that your application can programmatically perform an action in a report and listen for events from actions that users make from within the reports themselves.
What can you do with the Power BI JavaScript API?
With the JavaScript API you can manage reports, navigate to pages in a report, filter a report, and handle embedding events. The following diagram shows the structure of the API:
Manage Reports
The JavaScript API enables you to manage behavior at the report and page level:
- Embed a specific Power BI Report securely in your application – try theembed demo application
- Set access token
- Configure the report with the following settings:
- Enable and disable the filter pane and page navigation pane – try theupdate settings demo application
- Set defaults for pages and filters – try theset defaults demo
- Enter and exit full screen mode
Learn more about embedding a report
Navigate to Pages in a Report
The JavaScript API enbales you to discover all pages in a report and to set the current page. Try thenavigation demo application.
Learn more about page navigation
Filter a Report
The JavaScript API provides basic and advanced filtering capabilities for embedded reports and report pages. Try thefiltering demo application, and review some introductory code here.
Basic Filters
A basic filter is placed on a column or hierarchy level and contains a list of values to include or exclude.
const basicFilter: pbi.models.IBasicFilter = { $schema: "http://powerbi.com/product/schema#basic", target: { table: "Store", column: "Count" }, operator: "In", values: [1,2,3,4]}
Advanced Filters
Advanced filters use the logical operator And or Or, and accept one or two conditions, each with their own operator and value. Supported conditions are:
- None
- LessThan
- LessThanOrEqual
- GreaterThan
- GreaterThanOrEqual
- Contains
- DoesNotContain
- StartsWith
- DoesNotStartWith
- Is
- IsNot
- IsBlank
- IsNotBlank
const advancedFilter: pbi.models.IAdvancedFilter = { $schema: "http://powerbi.com/product/schema#advanced", target: { table: "Store", column: "Name" }, logicalOperator: "Or", conditions: [ { operator: "Contains", value: "Wash" }, { operator: "Contains", value: "Park" } ]}
Handling Events
In addition to sending information into the iframe, your application can also receive information on the following events coming from the iframe:
- Embed
- loaded
- error
- Reports
- pageChanged
- dataSelected (coming soon)
Learn more about handling events
Next Steps
For more information about the Power BI JavaScript API, check out the following links:
What is Power BI?
Power BI is a suite of business analytics tools to analyze data and share insights. Monitor your business and get answers quickly with rich dashboards available on every device.
Get the latest news from Power BI Blog
Articles by date
- July 2025
- June 2025
- May 2025
- April 2025
- March 2025
- February 2025
- January 2025
- December 2024
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- April 2021
- March 2021
- February 2021
- January 2021
- December 2020
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- May 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- August 2019
- July 2019
- June 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013