Embed a report in a secure portal or website

With the Embed choice for Power BI reports, you can easily and securely embed reports in internal web portals. These portals tin be deject-based or hosted on-premises, such every bit SharePoint 2019. Embedded reports respect all item permissions and data security through row-level security (RLS). They provide no-code embedding into any portal that accepts a URL or iFrame.

The Embed option supports URL filters and URL settings. It allows you to integrate with portals using a low-code approach requiring just basic HTML and JavaScript knowledge.

How to embed Power BI reports into portals

  1. Open a report in the Power BI service.

  2. On the File menu, select Embed report > Website or portal.

    Website or portal option

  3. In the Secure embed lawmaking dialog, select the link you lot can utilise to embed this content, or the HTML you tin paste into your weblog or website in an iFrame.

    Embed option dialog box

  4. Whether a user opens a report URL straight, or i embedded in a web portal, written report access requires authentication. The following screen appears if a user has not signed-in to Power BI in their browser session. When they select Sign-In, a new browser window or tab could open up. Accept them check for popular-upward blockers if they don't get prompted to sign in.

    Sign in to view this report

  5. After the user has signed in, the report opens, showing the information and allowing page navigation and filter setting. Only users who have view permission can see the report in Power BI. All row-level security (RLS) rules are besides practical. Lastly, the user needs to exist correctly licensed – either they need a Ability BI Pro or Premium Per User (PPU) license, or the report must be in a workspace that is in a Ability BI Premium capacity. The user needs to sign in each time they open up a new browser window. Yet, once signed in, other reports load automatically.

    Embed report

  6. When using an iFrame, y'all may demand to edit the height and width to have it fit in your portal's web page.

    Set height and width

Granting report access

The Embed option doesn't automatically permit users to view the study. View permissions are set in the Power BI service.

In the Power BI service, you can share embedded reports with users requiring access. If you're using a Microsoft 365 Group, you can list the user as a workspace member. For more information, encounter how to manage your workspace in Power BI and Microsoft 365.

Licensing

To view the embedded report, users need either a Power BI Pro or Premium Per User (PPU) license or the content needs to be in a workspace that's in a Ability BI Premium capacity (EM or P SKU).

Customize your embed experience using URL settings

You can customize the user feel using the embed URL'southward input settings. In the provided iFrame, y'all can update the URL's src settings.

Property Clarification
pageName Y'all can use the pageName query string parameter to set which study page to open up. Yous can notice this value at the written report URL's stop when viewing a study in the Power BI service, as shown below.
URL Filters You tin apply URL Filters in the embed URL yous received from the Power BI UI to filter the embed content. This way you can build low-code integrations with just basic HTML and JavaScript experience.

Set which folio opens for an embedded report

You can discover the pageName value at the report URL's end when viewing a written report in the Power BI service.

  1. Open the study from the Power BI service in your web browser, and then copy the address bar URL.

    Report section

  2. Append the pageName setting to the URL.

    Append pageName

Filter written report content using URL filters

You lot tin apply URL Filters to provide different study views. For example, the URL beneath filters the study to show data for the Energy industry.

Using the combination of pageName and URL Filters can be powerful. You can build experiences using basic HTML and JavaScript.

For instance, here'south a button you lot can add together to an HTML page:

              <push button class="textLarge" onclick='show("ReportSection", "Energy");' manner="display: inline-block;">Evidence Energy</push button>                          

When selected, the button calls a function to update the iFrame with an updated URL, which includes the Free energy industry filter.

              part show(pageName, filterValue)  {  var newUrl = baseUrl + "&pageName=" + pageName;  if(null != filterValue && "" != filterValue)  {  newUrl += "&$filter=Industries/Industry eq '" + filterValue + "'";  }  //Assumes there'south an iFrame on the page with id="iFrame"  var written report = document.getElementById("iFrame")  report.src = newUrl;  }                          

Filter

You can add as many buttons equally you'd like to create a low-code custom experience.

Considerations and limitations

  • Paginated reports are supported with secure embed scenarios, and paginated reports with URL parameters are also supported. Read more than about passing study parameters in a URL for a paginated report.

  • Secure embed works for reports published to the Power BI service.

  • The user needs to sign in to view the written report whenever they open up a new browser window.

  • Some browsers require you to refresh the page later sign-in, specially when using InPrivate or Incognito modes.

  • Yous may see issues if using unsupported browser versions. Ability BI supports the following list of browsers.

  • The classic SharePoint Server isn't supported, every bit it requires Internet Explorer versions earlier than 11, or enabling the compatibility view mode.

  • To attain a single sign-on experience, use the Embed in SharePoint Online pick, or build a custom integration using the user owns data embedding method.

  • The automatic hallmark capability provided with the Embed option doesn't piece of work with the Power BI JavaScript API. For the Ability BI JavaScript API, use the user owns information embedding method.

  • The authentication token lifetime is controlled based on your AAD settings. When the authentication token expires, the user volition need to refresh their browser to get an updated authentication token. The default lifetime is one hour, only it could be shorter or longer in your organization. There is no ability to automatically refresh the token in this scenario.

Next steps

  • Ways to share your work in Ability BI

  • Filter a study using query string parameters in the URL

  • Embed with written report web part in SharePoint Online

  • Publish to Web from Ability BI