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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
EChemali
Regular Visitor

Duplicate Datasets after Report Uploading using RESTful API

 

 Hello Community,


We created a customer facing product using Power BI embedded. We created a tool to automate the uploading of our Power BI reports using the Power BI RESTful API. Prior to uploading a report update, we delete the existing report (if exists) then upload the update as shown below..

                        String reportId = GetReportID(report.reportName, report.groupId, client);

                        if (reportId != null)

                        {

                            client.Reports.DeleteReportInGroup(report.groupId,reportId.ToString());

                        }

 

We have seen that the data sets from previous versions of the report stay behind and they are auto-refreshing these causes our Azure SQL Server DTU’s to be constantly in use. We have about 20 reports and we are constantly uploading updates, therefore the number of datasets being left behind are increasing. You can see our datasets being duplicated every time we upload a new report.

 

PBI_Dup_DS.JPG

 

My question is (and it may have an obvious answer, If so, apologize in advance) , should we manually delete the dataset first, then delete the report every time we update a report using the RESTful API?

 

If so, is something like the below code something we need to add prior to the client.Reports.DeleteReportInGroup(..) method??

 

var dsId = GetDatasetID(report.reportName, report.groupId, client);

client.Datasets.DeleteDatasetById(dsId.ToString());

 

Thank you all in advance.

Emilio

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @EChemali,

 

Based on research, current rest api contains refresh dataset function, but it seems like only suitable configured(setting gateway and other refresh options) datasets.(it similar as manually refresh)

 

For deatsets which manually create by rest api and push to power bi service, you can only remove original table rows and add new rows to achieve refresh option. Otherwise I think it will create duplicate datasets which you mentioned.

 

Notice: current rest api not has api to update existed tables, it also not contains function to update/replace original rows.

BTW, for operation rest api and power bi embedded, you can post to developer forum to get further support.

 

Regards,

Xiaoxin Sheng

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

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @EChemali,

 

Based on research, current rest api contains refresh dataset function, but it seems like only suitable configured(setting gateway and other refresh options) datasets.(it similar as manually refresh)

 

For deatsets which manually create by rest api and push to power bi service, you can only remove original table rows and add new rows to achieve refresh option. Otherwise I think it will create duplicate datasets which you mentioned.

 

Notice: current rest api not has api to update existed tables, it also not contains function to update/replace original rows.

BTW, for operation rest api and power bi embedded, you can post to developer forum to get further support.

 

Regards,

Xiaoxin Sheng

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

Thank you Xiaoxin for your help

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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