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.
Let’s get started! 🧐
*This tutorial is for Power BI Online (also called "Power BI Service").
Table of Content
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:
- Creating workspaces
- Using the ‘Share’ function
- Printing reports
- Bundling reports and dashboards into apps and distributing them
- Embedding reports to websites and portals
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! 😊
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 click ‘Publish to web (public)’.
If you’re on edit mode:
- Click ‘File’ on the menu above the canvas.
- Then, select ‘Publish 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:
Power BI will warn you one last time that you’re about to create an embed code for this report to be shared publicly.
Click ‘Publish’ to continue:
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:
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.
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 select ‘Website or portal’.
On edit mode:
- Click ‘File’ from the menu above the canvas.
- Then, click ‘Embed’.
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. 😃
All you need to do is replace the current width and height of the frame and you’re done.
If a user would like to see the report, they would have to sign-in to Power BI first as shown below:
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.
All you have to do is click the gear icon which represents settings on the upper-right corner.
Then, click ‘Manage 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. 👍