Microsoft Fabric  

Embed Power BI Report in Microsoft Fabric Notebook

Welcome to the Excel Jet Consult blog. In this blog, I am going to walk you through how to embed a Power BI Report into Fabric Notebook. Let's get started.

One of the benefits of embedding Power BI Report to Fabric Notebook, from the developer's point of view, might be to version control and collaborate with others by seamlessly integrating the workspace with GitHub through Azure DevOps. In the screenshot below, I've got a Power BI Report in my workspace that we will embed in the new Fabric Notebook

Sales report

Accessing Power BI Report HTML Code

We need to access the Report HTML code that we are going to paste into the Fabric Notebook to embed the report. To access the HTML Code:

  • In the Embed report dropdown of the File tab, click on Website or Portal Flyover.
    File
  • In the Securely embed this report in a website or portal window, click in the HTML box and copy the HTML code.
    ​​​​​.HTML

Create a Fabric Notebook

Next, we need to create a Notebook in the Fabric Notebook workspace already created. To create a new Notebook:

  • In the bottom left corner, click on the Power BI icon and switch to the Data Science experience
    Fabric Notebook
  • In the Synapse Data Science page, click on Notebook.
    Notebook
  • In the Notebook code window, select the first cell or any cell you desire and click on the PySpark dropdown at the bottom-right of the cell.
  • Switch to html language as seen below.
    HTML

We have the %%html magic command to initialize the instance of the HTML.

Paste the code in the same cell and click on Run to run the cell. Note I have adjusted the reported width and height to fit the report in the output cell. In addition, you will be asked to Sign in to your Power BI for the report to embed and be accessible.

In the screenshot below, the Power BI Report is successfully embedded into the Fabric Notebook. That is awesome!

HTML Code

Interact with Report

We can interact with the report by filtering. In this case, I selected Colorado in the State slicer object, and voila, the report responded accordingly, as seen in the screenshot below

Report

Conclusion

We have seen how to embed the Power BI Report into the Fabric Notebook. This opens endless opportunities for business intelligence experts, data scientists, and users to collaborate and consume Power BI reports. See you in the next tutorial