Power BI already has an easy way to embed Power BI reports into public websites with Publish to web and to secure SharePoint Online pages with the Power BI web part. However, embedding content into internal sites required advanced coding skills. Now, with the new secure Embed option, you can easily integrate your report with any internal site or portal so long as it allows embedding using an HTML code snippet or a URL.
This new option enables business users who do not have any coding skills to easily and securely embed reports in internal web portals, whether cloud-based or hosted on-premises. Reports embedded in this way respect all item permissions set in Power BI and data security through row-level security (RLS).
Getting started with the new secure Embed option
The new Embed option is available on the File menu for reports in the Power BI service.
Select the Embed option to open a dialog that provides a link and an HTML snippet that can be used to embed the report securely. You’ll need to use use your portal’s embed feature or edit the web page’s HTML to add the report.
After the report is embedded in your web portal, or if a user opens the URL directly, the user is authenticated before they can access to the report. Below, the user has not signed-in to Power BI in the browser session. When they press Sign-In, a new browser window or tab may need to open, so ensure you check for pop-up blockers if you do not get prompted to sign-in. The user needs to sign-in each time they open a new browser window. After they’ve signed in once other reports will load automatically.
After the user has signed-in, the report will open, showing the data and allowing users to navigate between pages and to set filters. The report is shown only to users who have permission to view the report in Power BI. All row level security (RLS) rules are also applied. Lastly, the user needs to be correctly licensed – either they need a Power BI Pro license, or the report must be in a workspace that is in a Power BI Premium capacity.
When using the iFrame option, it is best to edit the HTML provided to specify the desired height and width to fit into your portal’s web page.
Granting access to reports
The Embed option does not automatically give users permission to view the report. The permissions to view the report are set within the Power BI service.
To provide access to the report within the Power BI service, you can share the report with the users who require access to the embedded report. If you are using an Office 365 Group, you can list the users as a member of the app workspace within the Power BI service. For more information, see how to manage an app workspace.
Users viewing the embedded report need either a Power BI Pro license or the content needs to be in a workspace that’s in a Power BI Premium capacity (EM or P SKU).
Customizing your embed experience using URL Settings
The ability to create experiences without advanced coding skills, what’s know as low-code, is truly special with this capability.
The embed URL supports several input settings that help you customize your user’s experiences. If you’re using the HTML snippet provided, make sure you update the URL in the iFrame’s src setting.
|pageName||You can use the pageName query string parameter to set which page of the report to open. The pageName value corresponds to the end of the report URL when viewing a report in the Power BI Service, as shown below.|
How to set which page to open when the report is embedded
The value provided in the pageName setting corresponds to the end of the report URL when viewing a report in the Power BI Service.
Open the report from the Power BI service in your web browser, and then copy the URL from the address bar.
Append the pageName setting to the URL as follows:
How to filter report content using URL filters
For some advanced features, you can URL Filters to build more experiences using the report. For example, the URL below filters the report to show data for the Energy industry.
When pressed, the button calls a function to update the iFrame with an updated URL which includes the filter for the Energy industry.
You can add as many buttons as you’d like to create a low-code custom experience. The example shows a completed experience using this technique.
- The user will need to sign-in to view the report whenever they open a new browser window.
- Some browsers require you to refresh the page after sign-in, especially when using InPrivate or InCognito modes.
- To achieve a single sign-on experience, use the Embed in SharePoint Online option, or build a custom integration using the User Owns Data approach. Learn more about User owns data
- Secure embed does not support paginated reports or dashboards.
- Embedding in Portals for Azure B2B users is not yet supported.
When should I use the new Embed option instead of other options like Embed in SharePoint Online, Publish to web, or user owns data?
The new Embed option allows you to securely embed reports from Power BI in portals that do not have a native integration with Power BI, for example with SharePoint 2019. Use it whenever you need to embed in a web portal and you need to keep the data in the report secure.
If you’re using SharePoint Online, we recommend you use the Power BI web part in conjunction with the Embed in SharePoint Online option. This will give you a better experience than just using the Embed option, including single sign-on, more control over the embedded content.
If you want to make you report public and embed it in a public website then Publish to web is the right option. Publish to web should never be used with confidential or proprietary data.