- [Narrator] Power BI Feature Overview
Embed and Visualize with Power BI in Jupyter Notebooks.
As part of our vision to empower every individual,
team and organization to make better decisions
based on data within any platform,
we've made it possible to embed Power BI
directly into Jupyter Notebooks.
This update lets you integrate
your Power BI reports and visuals
directly in your data exploration process
by enabling you to embed your reports
in your Jupiter Notebooks, interact with the reports,
and export data from your visuals to your Jupyter Notebook
for in-depth data exploration.
To demonstrate, let's start with a Jupyter Notebook
into which we are going to embed a Power BI report.
Our first step is to import the report class
from the Power BI client package.
Next, we need to authenticate against Power BI.
Power BI provides multiple ways to do this
and we choose the device flow authentication method,
which best suits our needs.
We copy the authentication code
and enter it into the authentication dialog box,
then select Next.
Now we select the account we want to use to authenticate
and complete the sign-in process.
Going back to the notebook, we're now logged in.
To embed the report,
we must provide a report ID and a group ID,
which can be found in the URL of the report
we are embedding.
We are using an access token
previously generated to authenticate.
Setting some report event handlers,
such as loaded callback or error handling events,
we are ready to run the report.
Calling the report object
renders the report output into the notebook.
When the report render is complete,
the loaded callback event fires
and the specified text output displays under the report.
Jupyter enables us to interact with the report in two ways.
For example, I can export data from the report.
In this case, the sales map.
We can work with Pandas by getting the active page
and export summarized data from the sales map.
The exported data appears in the table.
We can also manipulate the exported data.
For example, removing the dollar sign
and changing the number format.
We can now visualize the data with the data frameworks plot.
All of these visualizations are ways of getting my data
to tell a story within a Jupyter Notebook.
We can also export and filter data from the notebook.
For example, by using a filter function
that will sort the data by region.
Finally, we can also use an ipywidgets interact function
to filter the report through user interface controls.
We can call the interact function
with our previously defined filter function
and the different regions.
When we select each of those areas,
the report displays changes
to show just the data from those regions.
For more information on embedded Power BI
and Jupyter Notebooks,
visit aka.ms/overview/2021RW2/PowerBI/JupyterNotebooks.
We also invite you to learn more
about Power BI at these links
and at powerbi.microsoft.com.
Thank you for watching.