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
solvisig
Advocate III
Advocate III

Query power bi dataset from Python or R

Is there any way to query PowerBI dataset from R or Python for data analysts?


I havent found any library to help me with this but seeing the latest news with improvements on the excel connector I´m hopeful there may be a solution for achieving this.

2 REPLIES 2
Covenant-bi
Helper I
Helper I

Yes, there are a few ways to query Power BI datasets from R or Python.

  • Use the Power BI API. The Power BI API is a RESTful API that allows you to interact with Power BI datasets from any programming language. There are libraries available for R and Python that make it easy to use the Power BI API.
  • Use the Power BI Desktop Query Editor. The Power BI Desktop Query Editor allows you to connect to a variety of data sources, including Power BI datasets. You can then use the Query Editor to query the data and export it to a file or a variable in R or Python.
  • Use a third-party library. There are a few third-party libraries that allow you to query Power BI datasets from R or Python. These libraries typically provide more features and functionality than the Power BI API or the Power BI Desktop Query Editor.

Here are some of the libraries that you can use to query Power BI datasets from R:

  • RPowerBI is a library that provides a high-level interface for querying Power BI datasets from R.
  • pbi.r is another library that provides a more low-level interface for querying Power BI datasets from R.
  • pyodbc is a library that allows you to connect to ODBC data sources from Python. You can use pyodbc to connect to a Power BI dataset that is published to an ODBC endpoint.
  • powerbi-connector is a library that provides a high-level interface for querying Power BI datasets from Python.

Hi, These libraries you mention do not allow me to query Power BI datasetes. They only interact with the Power BI API allowing me to work with administrations tasks from R.
I am looking for something to work with the data in the datasets.

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.

Top Kudoed Authors