cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
ErikVoorbraak
New Member

REST API for creating Power BI datasets, tables and columns

I'm looking for a REST API that I can use to manage Power BI datasets: create dataset, add/remove tables, add/remove columns, add/remove measures, etc. In my specific use case, I intend to consume such API in Java.

 

So far, I found this resource: https://learn.microsoft.com/en-us/rest/api/power-bi/, which allows me to get only base data of my datasets. I cannot access tables and columns, let alone modify them. The Java libraries I tried reflect this (https://github.com/satalyst/powerbi-rest-java, https://github.com/satya64/powerbi-sdk-java). 

 

I am aware that there is a possibility to do this using "Microsoft.AnalysisServices.Tabular.dll" (https://learn.microsoft.com/en-us/dotnet/api/microsoft.analysisservices.tabular.model?view=analysiss...), but as far as I can judge, there is no REST endpoint for this. Lastly, I looked at XMLA endpoints, which looked rather far from what I was expecting.

 

Am I missing some API? Any hints would be appreciated.

4 REPLIES 4
Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

@ErikVoorbraak  - this is the API call to import a dataset. Imports - Post Import In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn.  This will create or replace if already exists.

@Daryl-Lynch-Bzy So to import a dataset, I should send over a pbix file? I know that pbix is a ZIPped folder structure, most of which is quite readable, with one exception: the "DataModel" file (compressed with "xpress 9"). So how should I create the PBIX? Or should I send something different?

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @ErikVoorbraak - It is not possible to edit the Data Model (add/remove tables, add/remove columns, add/remove measures) via the Rest API.  You can only create, replace and refresh.

If you want to modify the Data Model (add/remove tables, add/remove columns, add/remove measures) you will need to use an XMLA endpoint tool.  Tabular Editor is the most popular external tool.  Try the paid version, Tabular Editor 3.  Tabular Editor 3

 

You may want to check out pbi-tools CLI | pbi-tools as this allows you to manage Power BI datasets GitHub / VS Code.

Hi Daryl,

 

Thank you for your answer. You wrote "You can only create, replace and refresh" - are you referring to the API documentation on https://learn.microsoft.com/en-us/rest/api/power-bi/? Looking in the section "Datasets", I cannot find a REST call to create or replace (non-empty) datasets. Should I look in a different place?

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.