Blog Post

Educator Developer Blog
3 MIN READ

Data Visualisation in Jupyter using PowerBI with Powerbi-jupyter

Lee_Stott's avatar
Lee_Stott
Icon for Microsoft rankMicrosoft
Feb 12, 2023

PowerBI and Jupyter are both popular tools for data visualization and analysis, but they have some differences in terms of their use cases, functionality, and target audience. PowerBI is a business intelligence tool from Microsoft that provides a visual and interactive way to analyze data from various sources, including spreadsheets, databases, and cloud services. It is user-friendly, easy to use, and ideal for business users who want to create dashboards, reports, and charts without the need for deep technical skills. PowerBI also has a cloud-based version that allows users to share and collaborate on their data and visualizations.

Jupyter is an open-source web-based platform that provides an environment for interactive computing and data visualization. It supports a variety of programming languages, including Python, R, and Julia, and is widely used by data scientists, engineers, and researchers for data analysis, prototyping, and scientific computing. Jupyter allows users to create and run code, view the results, and visualize the data in a notebook-style interface.


Many organisations utilise PowerBI for business users who want to create dashboards and reports, while Jupyter is better suited for data scientists and engineers who need to perform complex data analysis and visualizations. Both tools have their strengths and weaknesses, and the choice between the two often depends on the specific needs and requirements of the project.


Welcome to PowerBi-Jupter

Powerbi-jupyter is a python IPyWidget that enables customers to use many embedding capabilities in a Jupyter notebook seamlessly
The widget allows you to tell compelling data stories with Power BI in Jupyter notebooks by allowing you to embed Power BI reports, dashboards, dashboard tiles, report visuals, or Q&A directly into your Python Jupyter notebooks.


Getting Started

Install the Power BI Client for Jupyter from PyPI
 

You can install using pip:

pip install powerbiclient

Or if you use jupyterlab:

pip install powerbiclient
jupyter labextension install @jupyter-widgets/jupyterlab-manager

If you are using Jupyter Notebook 5.2 or earlier, you may also need to enable the nbextension:

jupyter nbextension enable --py [--sys-prefix|--user|--system] powerbiclient

Using the Demo Notebook



The demo notebook is a  Jupyter notebook that embeds a sample report. It demonstrates the complete flow of embedding and interacting with Power BI report i.e. embedding a Power BI report, setting report event handlers, get list of pages, get list of visuals, export and visualize visual data and apply filters.

Required python packages:

  • pandas
  • matplotlib

To run the demo, run the following commands:

cd demo
jupyter notebook

Now, run demo.ipynb


Conclusion 


Combining PowerBI and Jupyter is scenario specific but here are some of the ways they can be used together:


Using Jupyter to preprocess data: Jupyter's powerful programming capabilities can be used to perform data cleaning, preprocessing, and manipulation, before exporting the cleaned data to PowerBI for visualization and analysis.


Integrating PowerBI visuals in Jupyter: PowerBI's rich set of visualizations can be embedded in Jupyter notebooks, providing a more interactive and collaborative environment for data analysis.


Sharing Jupyter results with PowerBI: Jupyter's output can be exported to PowerBI, allowing users to create interactive dashboards and reports based on the results of their data analysis.


In summary, combining PowerBI and Jupyter can bring together the strengths of both tools, allowing users to perform complex data analysis and visualization, while also leveraging PowerBI's business intelligence capabilities for data insights and decision-making.

However, it's important to keep in mind that both tools have different strengths and weaknesses, and the choice of whether to use both will depend on the specific requirements of the project and the licenses which you have available.


Contributing to Open Source

You can find the open-sourced Python package and associate TypeScript widget on GitHub

Resources 

How to embed a Power BI component in a Jupyter notebook | Microsoft Learn

Embed Power BI in Jupyter Notebooks - report creation from DataFrames | Microsoft Learn

microsoft/powerbi-jupyter: A Custom Jupyter Widget Library for Power BI (github.com)


Future Releases

Microsoft Power Platform release plan Microsoft Power Platform plan overview - Power Platform Release Plan | Microsoft Learn

Updated Feb 13, 2023
Version 2.0
No CommentsBe the first to comment