How to Embed Power BI Report in Web Application

Cody Schneider

Want to display your interactive Power BI reports directly inside your website or application? You're in the right place. Embedding lets you bring data insights directly to your users, putting important metrics right where they work, shop, or manage their tasks. This guide breaks down the different ways to embed a Power BI report, from simple no-code options to more advanced solutions for developers building customer-facing applications.

Why Embed Power BI Reports in the First Place?

Before jumping into the "how," let's quickly cover the "why." Embedding isn't just about making your reports look cool in a new location, it's about making your data more effective.

  • Seamless User Experience: Instead of making users open another browser tab and log into Power BI, you bring the dashboard to them. This creates a smoother, more integrated experience within your platform or internal portal.

  • Data in Context: A sales report is useful on its own, but it's far more powerful when embedded directly on a CRM account page. Embedding lets you place data right alongside the related tools and information your team uses every day, providing context that drives better decisions.

  • Controlled Access and Security: You have full control over who sees which reports. Whether you're sharing with your internal team or thousands of customers, embedding frameworks allow you to manage permissions and keep sensitive data secure.

  • Driving Action: By placing interactive reports where work gets done, you empower people to not just view data, but to act on it immediately.

Understanding Your Primary Embedding Options

There are several ways to embed a Power BI report, and the right choice depends entirely on your audience and your security requirements. Broadly, these methods fall into two categories: simple, no-code embedding for public or internal sharing, and more robust developer-focused solutions for custom applications.

Method 1: Embedding with No Code

For many basic use cases, you don't need to write a single line of code to embed a report. Power BI offers a couple of straightforward options right from the web service.

Publish to Web (Public Embedding)

This is the fastest and easiest way to get an interactive report onto a public webpage, like a blog post or a public-facing website. It generates a simple <iframe> embed code that you can paste into any HTML page.

Heads Up: This method is NOT secure. Anyone on the internet with the link can view your report and underlying data. Do not use "Publish to web" for any proprietary or sensitive information. It's intended for public data visualizations only.

Here’s how to do it:

  1. Navigate to your report in the Power BI Service (app.powerbi.com).

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

  3. You will see a dialog box warning you about making your data public. Read it carefully and, if you're certain, click "Create embed code."

  4. Click "Publish." Power BI will generate a link and an <iframe> snippet.

  5. Copy the <iframe> code and paste it into the HTML of your website where you want the report to appear.

Embed for Internal Users (SharePoint Online)

If you use Microsoft 365 and want to embed a report in an internal team site, the SharePoint Online option is perfect. It's secure and respects all the Power BI permissions you've already set up. Users must have a Power BI license and permission to view the report.

  1. In the Power BI Service, open your report.

  2. Go to File > Embed report > SharePoint Online.

  3. A dialog box will appear with an embed URL. Copy this link.

  4. Go to your SharePoint Online page and add a new "Power BI" web part.

  5. In the web part's properties pane, paste the Power BI report URL you copied.

  6. The report will load directly on the SharePoint page, accessible only to logged-in users who have the correct permissions.

The Developer's Toolkit: Power BI Embedded Analytics

When you need to integrate Power BI reports tightly into your own custom web application, the Power BI embedded analytics solution is the way to go. This approach gives you full control over the user experience and security, making it ideal for SaaS companies, software vendors, and enterprises building rich internal tools.

This method requires backend and frontend development work. It revolves around a concept called "embed tokens," which are temporary, single-use credentials that grant a user secure access to a specific report.

Understanding the Two Primary Embedding Models

The developer approach is split into two models, depending on who your target user is.

1. Embed for Your Organization ("User Owns Data")

This model is for building internal applications for your colleagues or employees. In this scenario, your application's users are authenticated using their own company credentials (usually via Azure Active Directory). Each user must have a Power BI Pro or Premium Per User (PPU) license to see the embedded content.

Best for: Custom internal portals, integrating reports into proprietary line-of-business applications where every user is licensed.

2. Embed for Your Customers ("App Owns Data")

This is the more common model for SaaS applications. Here, your application uses a single "master" service principal or master user account to authenticate with Power BI on behalf of all its users. Your end-users don't need Power BI licenses and may not even know Power BI is being used. You pay for the Power BI resources through a dedicated capacity (Power BI Embedded or Power BI Premium capacity).

Best for: Independent Software Vendors (ISVs) or any company building a product where reports are shown to external customers who don't have accounts in your organization's directory.

General Workflow for "App Owns Data" Embedding

Let's walk through a high-level overview of the steps involved in the "Embed for Your Customers" model, as it’s the most powerful solution for custom applications.

Step 1: Set Up Your Power BI Environment

First, create a dedicated workspace in Power BI for your embedded content. You publish all the reports and datasets you want to embed into this workspace. To use the "App Owns Data" model, this workspace must be assigned to a dedicated capacity (e.g., an 'A' SKU for Power BI Embedded or a 'P' SKU for Premium).

Step 2: Register Your Application in Azure AD

Your application needs its own identity to authenticate securely with the Power BI REST APIs. You'll register your app in Azure Active Directory (Azure AD), which will provide you with a Client ID and allow you to create a Client Secret. These credentials act like a username and password for your application.

Step 3: Grant API Permissions

Within your app's registration in Azure AD, you'll need to grant it specific delegated permissions to the Power BI service. This typically includes permissions like Report.Read.All and Workspace.Read.All, which allow your application to read content from the Power BI workspaces.

Step 4: Implement Backend Logic to Generate Embed Tokens

This is the core of the development work and happens on your server. When a user in your application tries to view a report, your backend code will execute the following sequence:

  1. Authenticate: Use your app's Client ID and Secret to authenticate with Azure AD and get an access token for the Power BI service.

  2. Call Power BI API: Use this access token to call the Power BI REST API to generate an embed token. You will specify which report (and which dataset) this token should grant access to. You can also specify security rules (Row-Level Security) at this stage to ensure users only see their own data.

  3. Send Details to Frontend: Your server then sends the embed token, the report's unique ID, and its embed URL to the client-side code running in the user's browser.

Step 5: Render the Report on the Frontend

With the necessary configuration details from your backend, your frontend code can now render the report. You'll typically use the official Power BI client JavaScript library.

Your frontend JavaScript will look something conceptually like this:

And that's it! The Power BI JavaScript library handles the complex work of rendering the interactive report in your specified div and communicating securely using the token you provided.

Final Thoughts

Whether you're using a simple, public <iframe> for a blog post or building a multi-tenant SaaS application, Power BI provides a path to embed your data visualizations right where they're needed most. Choosing the right method comes down to understanding your audience, your budget, and most importantly, your security requirements.

While embedding is a great way to present finished reports, the traditional BI process of manually creating those reports can be a major bottleneck. At Graphed, we created a way to skip the steep learning curve and slow manual work of building dashboards. Instead of clicking through menus and dragging fields, you just connect your marketing and sales platforms (like Google Analytics, Shopify, Facebook Ads, and Salesforce), and describe the dashboard you want in plain English. Your report is built instantly, with real-time data just one conversation away.