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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
fortuit
Frequent Visitor

Get data from Power BI with Python

Hello,

Does anyone know how to connect to a dataset in Power BI desktop and export the content of this dataset using Python scripts?

I often see examples of using pandas package to import data in Power BI (from external sources to Power BI) but not the other way (from Power BI to external service)...

The idea is to be able to read data from power BI report, a bit like what can be done with pandas through "pandas.read_excel" when one wants to retrieves data from an xlsx file.

With the Power BI REST API, it seems we can only get list of dataset, not the content of dataset.

Any idea ?

2 REPLIES 2
dm-p
Super User
Super User

Hi @fortuit,

With the introduction of external tools into preview, you can create something to connect to Power BI Desktop via the local port your model exposes. David Eldersveld has a great 4 part worked example for doing this with Python - he uses Jupyter as a means of writing DAX against the model to extract data and you could probably leverage some of his work to see if you can do what you want.

Regards,

Daniel

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Greg_Deckler
Super User
Super User

@fortuit - Maybe via the Power BI REST API?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors