Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
yuktitekade
New Member

Powerbi client in Jupyter not giving me any output.

Hi All,

I hope everyone is really excited to see Power BI in Jupyter Notebook.

https://powerbi.microsoft.com/en-us/blog/announcing-power-bi-in-jupyter-notebooks/ 

 

I'm trying to embed an analysis I did in power BI into my jupyter notebook as shown in the steps in the article.

I created my active directory in Azure and gave all permisions. I can see the report load in https://playground.powerbi.com/ in the developer sandbox to play around with the embedded Report APIs but, when I try in Jupter, nothing reports.

 

It all gets loaded as per the article.

Simple code which I'm writing as shown in the article.

group_id="3fefc72b-de3e-4371-a700-63e7a7ea5e57" # I got from the link in my workspace in power bi service.
report_id="7f11a390-8189-4956-b465-e4624616ea87"
# Import Report class
from powerbiclient import Report
report = Report(group_id=group_id, report_id=report_id, auth=device_auth)

report

Now, when I run these commands, I expected to visualise my report in jupyter so I can use pandas and run some more analysis and complete my report for my team. However, I get nothing output. I tried for 3 days, used multiple techniques, tried in VS code, Anaconda, Jupyter everything. but nothing results out.

 

Can someone please help in understanding where I'm going wrong or anything further that I'm missing out.

 

Thanks so much in adavnce.

 

God Bless!

 

5 REPLIES 5
Pritesh14
New Member

Hi All,

 

I am using azure databricks notebook & trying to fetch power bi report which is published in power bi workspace.

Below is the code, but no report is getting displayed in notebook.

 

from powerbiclient import Report, models
from powerbiclient import Report
from powerbiclient.authentication import DeviceCodeLoginAuthentication
device_auth = DeviceCodeLoginAuthentication()
group_id="XXXXXXXXXXXXXXXXXXXXXXXXX"
report_id="XXXXXXXXXXXXXXXXXXXXXXXX"
report = Report(group_id=group_id, report_id=report_id, auth=device_auth)
report

 

Databricks notebook screenshot

Code_1.pngcode_2.png

As seen report command does not display power bi report. It just display report() as result.

Databricks Version -- 8.3 (includes Apache spark 3.1.1, Scala 2.12)

 

Please help me on this as how i can see the report in databricks notebook.

 

Thanks 

 

 

 

Please let me know if anyone was able to use the powerbiclient library in the azure databricks 

S-Wald
Regular Visitor

Hi @yuktitekade --  I'm noticing in your import statement a small deviation from the demo code in the blog (which has worked for me). Namely, adding `models` to your import: `from powerbicclient import Report, models`  Have you tried that?

 

Also, I have only been able to get embedding to work in a notebook launched from the "old time" Jupyter Notebook, NOT from a notebook launched from Jupyter Lab. 

 

Good luck!

yuktitekade
New Member

Hi @v-yiruan-msft , Thanks for your reply, but unfortunately it didn't work either.

I'm currently using 6.0.1 version of Jupyter notebook and the latest Python 3.7.4 in Jupyter.

Moreover, I've already installed and used Pandas and Matplotlib libararies for my other projects in Jupyter.

 

Please let me know if you have any other ideas as well and I can try and run those over to get my powerbi in Jupyter notebook.

 

Thanks!

-Yukti

v-yiruan-msft
Community Support
Community Support

Hi @yuktitekade ,

Did you install the Power BI Client for Jupyter? 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

PyPI

Github

Besides that, whether the following 2 Phython packages be installed or not?

  • pandas (for editing queries (datasets))
  • matplotlib (for creating visuals)

Install Python and Python Packages

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.