DEV Community

Cover image for How to Publish a Power BI Report and Embed it into a Website
Jonathan kip
Jonathan kip

Posted on

How to Publish a Power BI Report and Embed it into a Website

How to Publish a Power BI Report and Embed It into a Website

Publishing a Power BI report and embedding it on a website is a straightforward process that lets you share interactive dashboards with anyone online. Below is a step-by-step guide covering both public and secure embedding options. learn.microsoft

Step 1: Prepare and Publish Your Report to Power BI Service

Before you can embed a report, it must be published to the Power BI cloud service.

  1. Open your report in Power BI Desktop

    Make sure your .pbix file is complete and saved. dev

  2. Click Publish

    In the Home tab, click the Publish button. dev

  3. Sign in and select a workspace

    If prompted, sign in to your Power BI account, then choose the workspace where you want to publish the report. dev

  4. Confirm the upload

    Once published, you’ll see a success message with a link to open the report in the Power BI service. dev

Step 2: Generate the Embed Code

You have two main options depending on whether you want the report to be publicly accessible or restricted to authenticated users.

Option A: Publish to Web (Public)

Use this if you’re okay with anyone on the internet viewing your report—ideal for portfolios, blogs, or public dashboards. learn.microsoft

  1. Open your report in Power BI Service

    Go to app.powerbi.com, navigate to your workspace, and open the report. learn.microsoft

  2. Click File > Embed report > Publish to web (public)

    This opens the embed dialog. learn.microsoft

  3. Review the warning

    Power BI will warn you that the report will be public. Confirm only if your data is safe to share. learn.microsoft

  4. Create embed code

    Click Create embed code, then copy the <iframe> HTML snippet provided. dev

Option B: Secure Embed (Website or Portal)

Use this for internal dashboards where viewers must log in to Power BI. learn.microsoft

  1. Open your report in Power BI Service

    Navigate to your workspace and open the report. learn.microsoft

  2. Click File > Embed report > Website or portal

    This opens the secure embed dialog. learn.microsoft

  3. Copy the link or iframe code

    You can either copy the embed link or the <iframe> HTML snippet to paste into your site. learn.microsoft

Step 3: Embed the Report on Your Website

Now that you have the embed code, you can add it to your website.

For Custom HTML Sites

  1. Open your HTML file

    Use a code editor like VS Code or your CMS editor. dev

  2. Paste the iframe code

    Insert the <iframe> snippet inside the <body> section where you want the report to appear. dev

  3. Save and publish

    Upload the updated file to your web server or publish the changes in your CMS. dev

For WordPress or Other CMS Platforms

  1. Open the page editor

    Go to the page where you want the report. dev

  2. Add a Custom HTML block

    In WordPress, insert a “Custom HTML” block. dev

  3. Paste the iframe code

    Drop the code into the block and update or publish the page. dev

Important Considerations

  • Data privacy: Only use “Publish to web” if your report contains no sensitive or confidential data. learn.microsoft
  • Admin settings: Your organization’s Power BI admin may need to enable “Publish to web” in the admin portal. youtube
  • Responsiveness: You can adjust the width and height attributes in the iframe to fit your site’s layout. learn.microsoft

With these steps, your Power BI report will be live and interactive on your website, letting visitors explore your data in real time. dev

Top comments (0)