DEV Community

Cover image for HOW TO PUBLISH A POWER BI REPORT AND EMBED IT INTO A WEBSITE
Emman Kibet
Emman Kibet

Posted on

HOW TO PUBLISH A POWER BI REPORT AND EMBED IT INTO A WEBSITE

Introduction to Power BI
Power BI is Microsoft's flagship business intelligence platform that transforms raw data into interactive visualizations and actionable insights. It consists of two main components:
Power BI Desktop: A Windows application for data modeling, transformation (Power Query), calculations (DAX), and report creation
Power BI Service: A cloud-based SaaS platform for sharing, collaborating, and distributing reports across organizations
Throughout this course, you've mastered queries, DAX calculations, data modeling, relationships/joins, and visualization creation. The final step in the BI workflow is publishing your reports so stakeholders can access insights—and optionally embedding them publicly or securely into websites.

Part 1: Creating a Workspace
Workspaces are collaborative environments in Power BI Service where you store, organize, and share content.
Step 1: Access Power BI Service
Navigate to app.powerbi.com and sign in with your Microsoft credentials
You'll land on the Home page showing recent content and recommended reports
_Step 2: Create a New Workspace
_1.In the left navigation pane, click Workspaces → Create a workspace
2.In the dialog that appears, configure:
-Workspace name: Electronics-Sales-Analytics (or your preferred name)
-Description: "Week 3 Assignment - Electronics Sales Dashboard"
-Advanced settings (optional): Configure workspace OneDrive, license mode, or contact list
3.Click Apply to create the workspace

Part 2: Uploading and Publishing Your Report

You have two methods to get your .pbix file into the workspace:
Method A: Upload via Power BI Service (Browser)
1.In your new workspace, click Upload → Browse
2.Locate your Electronics_Sales_Assignment.pbix file
3.Select Open and wait for the upload to complete
4.Power BI automatically creates:
A Report (the visualizations)
A Semantic Model/Dataset (the underlying data model)

Method B: Publish from Power BI Desktop

1.Open your .pbix file in Power BI Desktop
2.Click File → Publish → Publish to Power BI
Alternative: Click the Publish button on the Home ribbon
3.Sign in to Power BI if prompted
4.Select your destination workspace from the list
5.Click Select to publish

Part 3: Generating Embed Codes
Power BI offers three embedding methods depending on your security requirements:
| Method | Security Level | Best For |
| --------------------- | -------------------------- | ------------------------------------ |
| Publish to Web | Public (no authentication) | Public data, blogs, marketing |
| Secure Embed | Private (requires login) | Internal portals, confidential data |
| Power BI Embedded | Developer-controlled | ISVs, custom applications |

*Method 1: Publish to Web (Public) *
Steps:
1.In Power BI Service, open your published report
2.Navigate to File → Embed report → Publish to web (public)
3.Review the information dialog and click Create embed code
4.Read the security warning carefully, then click Publish
5.In the Success dialog, configure:
Size: Choose dimensions (e.g., 800×600)
Default page: Select which report page displays first
Placeholder image (optional): Improves page load speed
Copy either:
Link URL: For sharing via email or direct links
HTML iframe code: For embedding in websites

*Method 2: Secure Embed *
For secure, authenticated access:
1.Go to File → Embed report → Website or portal
2.Copy the provided URL or HTML code
3.Users must sign in with Power BI Pro/PPU licenses to view
4.Ensure you've shared the report with intended users via the Share button

Part 4: Embedding the Report on a Website
For Static Websites (HTML)

Paste the iframe code directly into your HTML:

For Content Management Systems (WordPress, etc.)
1.Add a Custom HTML block
2..Paste the iframe code provided by Power BI
3.Adjust width/height to fit your theme's content area
_For SharePoint Online _
1.In Power BI: File → Embed in SharePoint Online
2.Copy the provided link
3.In SharePoint: Add a Power BI web part
4.Paste the link into the web part properties

Part 5: GitHub Submission
As per assignment requirements, upload your source file to GitHub:
1.Create a GitHub repository (e.g., powerbi-electronics-sales)
2.Upload files:
Electronics_Sales_Assignment.pbix (your Power BI file)
README.md (documentation)
embed-code.txt (containing your generated HTML iframe code)

Conclusion
Publishing and embedding Power BI reports bridges the gap between data analysis and business action.

Top comments (0)