Skip to content

Service Details

Matt Mazzola edited this page Aug 8, 2016 · 6 revisions

As of 2.x Power BI will NOT automatically search your apps DOM for Power BI embed components on page load. If you need this behavior you need to configure the service for this.

To simulate the old behavior you have two options.

  1. If executing before the DOM is ready you can run the code below which will setup a DOM ready event listener which will call powerbi.init()
powerbi.enableAutoEmbed();

Otherwise, if your executing after the DOM is ready you can call:

powerbi.init();

This will search for elements with the powerbi-embed-url attribute and attempt to embed within them using the attribute data.