Microsoft Fabric Updates Blog

Create Power BI reports in Jupyter Notebooks

Introducing a Game-Changing Update to the Power BI and Jupyter Notebook Library: Create Compelling Power BI Reports Directly in Your Notebook!

In today’s world where data is everywhere, we understand the importance of easy-to-use data visualization and analysis in gaining insights and making informed decisions. That’s why we are excited to announce the latest update to the Power BI and Jupyter Notebook library, which empowers users to create powerful reports based on their data directly in their notebooks, without leaving their workflow. With this new update, users can gain insights instantly without the hassle of switching between tools or dealing with cumbersome data exports.

 

Create a Power BI report in a Jupyter Notebook
Create a Power BI report in a Jupyter Notebook

The updated Power BI Client for Jupyter is available on PyPI. The open-sourced Python package, as well as the complete documentation and demos can be found on GitHub.
 

How to create a report in a Jupyter Notebook

The process is simple. Start by installing powerbiclient using pip, and then import into your notebook the relevant models from the package,  pandas for working with DataFrames, and any other modules you need for your data processing.

from powerbiclient import QuickVisualize, get_dataset_config, Report
from powerbiclient.authentication import DeviceCodeLoginAuthentication

import pandas as pd

Then, create a pandas DataFrame from your data, perform any necessary preprocessing, and authenticate to Power BI using our provided authentication class. With your DataFrame and authentication in place, you can now create a Power BI report instance, which will auto-generate a Power BI report from your data within seconds.

# Create a Power BI report from your data
PBI_visualize = QuickVisualize(get_dataset_config(df), auth=device_auth)

# Render the new report
PBI_visualize

The generated report will include interactive and visually appealing visualizations, allowing you to easily tell the story of your data in a compelling way. You can customize the report further by editing the visuals and saving them as needed, or selecting different fields to take part in the data visualizations.

Edit the auto-generated report
Edit the auto-generated report

 

Next steps

Once you’re happy with your report, you can keep it in the notebook, or manually save the generated reports to share them with your team or organization in Power BI for wider consumption. This allows for seamless collaboration and empowers you to fully utilize the capabilities of Power BI for data analysis and visualization. The saved report can also be loaded in the notebook or in any other notebooks using the existing Power BI and Jupyter library.

With this latest update to the Power BI Jupyter Notebook library, you can now unlock the true potential of your data analysis workflow. Gain insights instantly without hassle, and create visually stunning reports right in your notebook where your data is.

Try it out today and revolutionize your data visualization workflow with Power BI in Jupyter Notebook!

Related blog posts

Create Power BI reports in Jupyter Notebooks

October 17, 2023 by Lee Benjamin

You asked, we deliver! The option to create a customized pipeline of 2-10 stages is now available. Check it out!

October 9, 2023 by Kay Unkroth

We have some very exciting news to share with you today! We are thrilled to announce that we have just launched the public preview of Direct Lake mode for Power BI datasets in Fabric! Fabric is taking a bold bet on open data formats in OneLake.