gbrueckl / PowerBI.API.Client

A C# wrapper for the Power BI REST API which allows you to easily integrate the Power BI API into your C# application.
MIT License
39 stars 14 forks source link

How to Add table to existing DataSet #21

Open AnalitIT opened 3 years ago

AnalitIT commented 3 years ago

Hi,

I have a Push DataSet created with one table. Now I want to add another table to the same dataset, using the following code:

`PBITable CrTable = new PBITable(dtCr); CrTable.ParentDataset = DataSet; DataSet.AddOrUpdateTable(CrTable); CrTable.PublishToPowerBI(true);

DataSet.PublishToPowerBI();`

When we hit CrTable.PublishToPowerBI(true); I get the following exception:

'{"error":{"code":"ItemNotFound","message":"Table '<pi>Cr</pi>' not found in dataset 'sobe_wowvirtualserver|892d0dc4-c0f4-493f-b2b9-4e553dbefcfc'"}}'

What is the way to go to add another table to an existing DataSet?

gbrueckl commented 3 years ago

actually I do not know if this is supported by the REST API at all there is no API to update an existing Push dataset but only to create brand new ones: https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_postdataset

is this an option for you?