Power BI Embedded performance best practices
This article provides recommendations for faster rendering of reports, dashboards, and tiles in your application.
Remember that loading time mainly depends on elements relevant to the report and data itself, including visuals, the size of the data, and the complexity of the queries and calculated measures. For more information, see Power BI performance best practices.
Update tools and SDK packages
Keep tools and SDK packages up-to-date.
Always use the latest version of Power BI Desktop.
Install the latest version of the Power BI client SDK. We continuously release additional enhancements, so make sure to follow up from time to time.
powerbi.embed(element, config) method receives an element and a config. The config parameter includes fields that have performance implications.
Avoid generating the embed URL yourself. Instead, make sure you get the Embed URL by calling Get reports, Get dashboards, or Get tiles API. We added a new parameter to the URL called config, which is used for performance improvements.
Provide View permissions if you're not intending to embed a report in edit mode. This way, embedded code doesn't initialize components, which are used in edit mode.
Filters, bookmarks, and slicers
Usually, report visuals are saved with cached data. The cached data is used to give perceived performance. Reports render cached data while queries are executed. If filters, bookmarks, or slicers are provided, cached data isn't relevant and the visuals are rendered only after the visual query has ended.
If you embed reports with the same filters, bookmarks, and slicers, to improve your performance, save the report with the filters, bookmarks, and slicers already applied. This renders the report with the cached data which includes the filters, bookmarks, and slicers.
Switching between reports
When embedding multiple reports to the same iframe, don't generate a new iframe for each report. Instead, use
powerbi.embed(element, config) with a different config to embed the new report.
Switching between reports for an 'App owns data' scenario might not be very effective due to the necessity of generating a new embed token.
Organizations with Power BI Premium capacity or Power BI Embedded capacity can take advantage of query caching to speed up reports associated with a dataset.
Call preload if you're not embedding the report immediately. For example, if you embed a report on a button click, it’s better to call preload when the previous page loads. Then, when the application user clicks the button, the rendering is faster.
It's not recommended to use preload if the report is about to be embedded. Instead, you can use bootstrap to prepare the iframe for embedding.
Bootstrapping the iframe
Power BI client SDK version 2.9 (beta) is required to bootstrap the iframe.
powerbi.bootstrap(element, config) can be used to prepare the iframe for embedding. The main use case for this feature is to parallelize the iframe bootstrap and the back-end calls that are used for embedding (for example, Get reports call).
To measure embedded performance, you may use two events:
- Loaded event: The time until the report is initialized (the Power BI logo will disappear when the load is finished).
- Rendered event: The time until the report is fully rendered, using the actual data. The rendered event is fired each time the report is re-rendered (for example, after applying filters). To measure a report, make sure you do the calculations on the first raised event.
Cached data is rendered when available but no additional event is generated.
To examine the performance of the report elements, you might use the Performance Analyzer in Power BI Desktop. The Performance Analyzer will allow you to see and record logs that measure how each of your report elements performs.
Always remember to compare the embedded report performance to the performance on powerbi.com. This might help you understand the origin of your performance issues