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
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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.