DEV Community

Kahuthu Muriuki
Kahuthu Muriuki

Posted on

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

Working with data professionally means that building a report is only half the job. The other half is making sure the right people can actually see it — without having to log into a dedicated analytics platform every time they need an update. That is where publishing and embedding come in.

In my work across data-heavy environments, I have found that one of the most practical things you can do with a finished Power BI report is push it to the web. Whether you are sharing dashboards with a broader team or surfacing insights on an internal site, the steps are straightforward once you know the flow. This guide walks through the full process — from setting up a workspace to getting your report live on a webpage.


What Is Power BI?

Power BI is a data analytics tool that takes raw data and turns it into interactive reports and visual dashboards. It connects to a wide range of data sources and gives you the ability to explore trends, track KPIs, and present findings in a format that non-technical stakeholders can actually engage with. It sits somewhere between a reporting tool and a full business intelligence platform — practical enough for day-to-day analysis, and capable enough for more complex data modelling work.


The Publishing and Embedding Process at a Glance

The overall flow has four stages:

  1. Creating a workspace in the Power BI service
  2. Uploading and publishing your report from Power BI Desktop
  3. Generating an embed code from the published report
  4. Pasting that code into an HTML file to display the report on a website

Let us go through each stage step by step.


1. Creating a Workspace

A workspace in Power BI is a shared environment where you organise and host your reports, dashboards, and datasets. Think of it as a project folder in the cloud — one that can be accessed and managed by multiple team members.

Step 1: Open your browser and navigate to https://app.powerbi.com.

Step 2: Sign in with your account credentials.

Sign in to Power BI

Step 3: Once logged in, find the left-hand navigation panel and click on Workspaces.

Step 4: Click + New Workspace to begin creating your workspace.

Create a new workspace

Step 5: A side panel will appear. Enter a name and a brief description for your workspace, then click Apply to save it. Give it a name that clearly reflects the project or report it will host — this saves confusion later, especially if you manage multiple workspaces.


2. Uploading and Publishing Your Report

With your workspace ready, the next step is getting your report from your local machine into the Power BI service.

Step 1: Open the Power BI Desktop file (.pbix) containing your report on your computer.

Step 2: At the top right of the Power BI Desktop interface, click the Publish button.

Publish button in Power BI Desktop

Step 3: A dialog box will appear prompting you to choose a destination. Select the workspace you just created.

Once the upload finishes, your report becomes accessible through the Power BI service. You will see a confirmation screen indicating the publish was successful.


3. Generating the Embed Code

Power BI gives you a way to embed reports directly into external web pages using an iframe snippet. Here is how to get that code.

Step 1: Open the published report in the Power BI service (navigate to your workspace and click on the report).

Step 2: In the top menu, click File.

Step 3: Hover over Embed report, then click Website or portal from the submenu that appears.

Embed report option

Step 4: A pop-up will display your embed code — an iframe snippet that you can copy directly.

Copy that code. You will need it in the next step. It is worth noting that this option makes your report publicly accessible to anyone with the link, so be deliberate about what data you expose this way.


4. Embedding the Report on a Website

With the embed code in hand, the final step is placing it inside an HTML file so that the report renders in a browser.

Step 1: Visit https://www.w3schools.com/html/ and copy one of the basic HTML page templates to use as your starting structure.

HTML template reference

Step 2: Open a text editor of your choice. On your desktop, create a new folder and give it a name — this will hold your HTML file.

Setting up the project folder in a text editor

Step 3: In the text editor, open that folder and create a new file with a .html extension. Paste the HTML template you copied from the reference site into the file.

Creating the HTML file

Step 4: Inside the HTML file, locate the body section and replace the placeholder content with your Power BI embed code. Save the file.

Step 5: Navigate to the folder you created on your desktop and open the HTML file in your browser.

Report loading in browser

Step 6: Sign in when prompted. Once authenticated, your Power BI report will render directly on the page.


Key Insights

A few things worth keeping in mind as you work through this process:

The "Publish to web" option is public by default. When you use the Website or portal embed path, the report is visible to anyone who accesses that page — no login required on the viewer's end. This works fine for general-purpose dashboards, but if your report contains sensitive data (financial records, client information, operational metrics), consider authenticated embed options instead, which require a Power BI Pro or Premium licence.

Workspaces determine access and governance. The workspace you publish to controls who can view, edit, or manage the report within the Power BI service. Set up workspace access roles deliberately before sharing.

The embed code is tied to the published report. If you update and republish the report, the embed code typically remains valid and reflects the latest version automatically. You do not need to regenerate it every time you make changes to the underlying report.

This is a starting point, not the only approach. The method covered here — using a static HTML file — is the quickest way to test that your embed works. In a production environment, you would drop the same iframe code into your CMS, website template, or internal portal instead. The embed behaviour is the same regardless of where it sits.

Data currency depends on your refresh schedule. The report on your website reflects whatever data was loaded the last time Power BI refreshed the dataset. If you need the embedded report to stay current, configure a scheduled refresh in the Power BI service settings for your dataset.


Publishing a Power BI report and embedding it on a web page is a practical skill that closes the gap between analysis and audience. The built-in tooling handles most of the heavy lifting — the main thing you are doing is connecting the right pieces in the right order.

Top comments (0)