Share via


Work with a Power BI instance

Learn how to get or reset a Power BI instance. For example, you might need to get a report instance in order to set filters.

Get a reference to an existing Power BI component

The powerbi.get method is used to retrieve an embedded instance when there is already an embedded item on the given <div>.

Usually, you get a Power BI item instance (like a report) by using the powerbi.embed or powerbi.bootstrap methods. But if you need to get an item instance after the report is embedded, you might not be able to use them. In these cases, use the get method to retrieve the instance.

let report = powerbi.get(element);

Reset an element

If you have embedded a report within an element, and want to reset the element back to its initial state, call:

powerbi.reset(element);

This method removes the embed from the service and removes the iframe, which is required to prevent the service from holding on to the reference that doesn't exist in the DOM. You typically need to call the reset before the containing element is removed from the DOM by the parent.