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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
StefanKainz
Frequent Visitor

Push Dataset create table API

Hello,

 

I've created a push dataset with two tables via API as documented here: Push Datasets - Datasets PostDataset - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Now I'd like to add another table to the existing dataset, but couldn't find an API to do this. Can anyone give me a hint how to do this?

 

The PutTable API (Push Datasets - Datasets PutTable - REST API (Power BI Power BI REST APIs) | Microsoft Learn) only allows to change an existing table, but not creating one.

 

BR Stefan

9 REPLIES 9
v-shex-msft
Community Support
Community Support

Hi @StefanKainz ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

My experience is that it is faster to start over. Prepare the meta data for both tables, and then (re)fill them. You can use SSMS if that's more convenient for you.

What do you mean by starting over again? When the push dataset already exists, how can we start over without losing any settings/permissions we have already done?

 

The scenario is like we have two production machines that collect data in different intervalls, lets say every 10 seconds for machine1 and every 20 seconds for machine2. That are the two tables that already exists. We push data to these two tables via API over the day and delete the data once every night and refill them with the last 4 hours of data.

 

How to add another table for one more machine (machine3) that collects data every 30 seconds?

delete all tables and then submit a single combined request to create the new table structures.  Then fill these new tables.

 

You may be trying to use push datasets in a way that they were not designed for. You may want to look at alternatives like streaming datasets.

... submit a single combined request to create the new table structures


That is exactly my trouble. The question is: HOW to create the new table structures?

Like this

https://learn.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-post-dataset-in-group

 

 

{
  "name": "Demo Export",
  "defaultMode": "Push",
  "tables": [
    { "name": "table1",
      "columns": [
        {
          "name": "Result",
          "dataType": "Int64"
        }
      ]
    },{ "name": "table2",
      "columns": [
        {
          "name": "fieldName",
          "dataType": "string"
        }
      ]
    },{ "name": "table3",
	  "columns": [
		{
		  "name": "ROWID",
		  "dataType": "string"
		}
	  ]
	}
  ]
}

 

Looking at my notes it actually seems to be possible to add a table.

https://learn.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-put-table-in-group

 

{
"name": "table3",
"columns": [
{
"name": "ROWID",
"dataType": "string"
}
]
}

 

 

Hello @lbendlin,

thank you once more for your reply.

 

We cannot delete and recreate the whole dataset as explained. All depending reports and dashboard tiles would be gone too. So this is not an option.

 

I tried to create a new table with https://learn.microsoft.com/en-us/rest/api/power-bi/push-datasets/datasets-put-table-in-group, but got the following errormessage:

{
    "error": {
        "code": "ItemNotFound",
        "message": "Table '<ccon>newTable</ccon>' not found in dataset 'sobe_wowvirtualserver|53ad1280-07a7-41dc-95cb-f5a283c199cb'"
    }
}

 

Any further suggestions?

 

BR Stefan

We cannot delete and recreate the whole dataset as explained

Power BI datasets semantic models are ephemeral. You MUST be able and ready to recreate them at any time. Do not rely on Power BI for any sort of long term storage.

 

Can you show the XMLA?

 

(If you think about the effort you have already put in all of this - would it have been quicker to start from scratch?)


Do not rely on Power BI for any sort of long term storage.

We do not rely on Power BI for long term storage, no worries. We keep all the data and schema safe at another service. We cannot drop and recreate the dataset because we plan potentially dozens of reports and dashboards that would be gone/break when dropping the dataset semantic model.

 


If you think about the effort you have already put in all of this - would it have been quicker to start from scratch?

At the moment we start from scratch every day a few times. We are just evaluating the possibilities we have with push datasets. And we use to take all the necessary time to make sustainable architectural decisions.

 

Thanks again for all your explanations. For me it's clear now that it is not possible to add a table to an existing push dataset after it has been created and we have to find another solution to work with changing requirements.

 

BR Stefan

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.