How to Embed a Power BI Report in a Website (Fast and Easy)

Written by co-founder Kasper Langmann, Microsoft Office Specialist.

Embedding a Power BI report to a website is simple and relatively easy.

You don’t need programming expertise to do it. In fact, all you have to do is copy and paste the code.

However, there are some questions in regards to embedding a report:

  • Is it safe?
  • Can anyone see it?

In this article, we’ll show you how you can embed a Power BI report on a website fast and easy. You’ll also find answers to some of the questions you have.

Kasper Langmann, Co-founder of Spreadsheeto

Let’s get started! 🧐

*This tutorial is for Power BI Online (also called "Power BI Service"). If you have Power BI Desktop, then click here and go to the online version.

Introduction to Power BI’s Embed Feature

After creating Power BI reports out your dataset, you might want to share your work with your colleague or others.

There are lots of ways to share a report:

Before, there was only one way to embed a report to a site. And that involves publishing the report publicly.

But with the new embed option, you can now easily and securely embed reports to websites and internal web portals.

In case you would like to embed a report and publicly publish it, we’ll also show you how. So buckle up! 😊

Kasper Langmann, Co-founder of Spreadsheeto

Embedding on a Public Website

This feature would let you easily embed interactive Power BI reports online publicly.

However, be warned that anyone can view your published content. Make sure that the content doesn’t cover any confidential or proprietary information.

To start, if you’re on reading view:

  • Click the ellipsis icon (…) on the menu above the canvas.
  • Then, hover your mouse over ‘Embed’ and clickPublish to web (public)’.

If you’re on edit mode:

  • ClickFile’ on the menu above the canvas.
  • Then, selectPublish to web’.

A dialogue box will open reminding you that you’re embedding on a public website.

To continue, press the ‘Create embed code’ button:

Creating the embed code for a public website

Power BI will warn you one last time that you’re about to create an embed code for this report to be shared publicly.

ClickPublish’ to continue:

Power BI warning the designer about creating an embed code to be shared publicly

After that, Power BI will give you two things:

  • A link you can send in email
  • The HTML code you need to embed your report

If you would like to change the size of your report, choose from the available sizes. It will automatically change the code above.

Then, copy and paste the code to your website to embed the report.

Here’s how it would look on the browser:

How the embedded report looks after embedding on a website

The report is interactive the same way when viewed in reading view. Take note that everybody on your website can see and interact with the report — no authentication required.

Kasper Langmann, Co-founder of Spreadsheeto

Embedding Securely on a Website

This feature is new and allows designers and developers to embed reports securely.

Meaning, only those within the organization can view and interact with the report.

However, before they can see the report, they need to have a Power BI Pro license. Or, they could be a free user but the report must be in a Power BI Premium workspace.

The steps involved in embedding a report securely is fairly similar to the previous section.

On reading view:

  • Click the ellipsis icon (…).
  • Then, hover your mouse over ‘Embed’ and selectWebsite or portal’.

On edit mode:

  • ClickFile’ from the menu above the canvas.
  • Then, clickEmbed’.

You’ll then get the link and HTML code you can use to embed the report.

If you need to customize the size of your frame, you will have to do it manually. But don’t worry, it’s fairly easy. 😃

Kasper Langmann, Co-founder of Spreadsheeto

All you need to do is replace the current width and height of the frame and you’re done.

A link and HTML to embed the report securely

If a user would like to see the report, they would have to sign-in to Power BI first as shown below:

How the securely embedded report looks after embedding on a website

Managing Embed Codes

The question is:

What if you need to embed the report again to another website? Do you have to go through the same process again?

Well…you can if you like. But it’s not necessary.

You can manage all your embed codes — get code for reuse or delete — straight from Power BI.

Kasper Langmann, Co-founder of Spreadsheeto

All you have to do is click the gear icon which represents settings on the upper-right corner.

Then, clickManage embed codes’:

How to manage the embed codes

To get the code or the delete the embed code, click the ellipsis (…) in line with the associated report and choose the action.

Easy! 👍

Conclusion

With Power BI’s embed feature, you have the option of embedding your report for private or public use. Both of which are easy to do.

Again, you might have to think hard if you’re considering publishing your report publicly. That would make your report available for everyone’s eyes. Make sure you’re not sharing sensitive or proprietary information even for a demonstration. 👍

Kasper Langmann, Co-founder of Spreadsheeto