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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

REST API - Post Import not replace pbix file

Hi,

I try use this rest api command:
https://docs.microsoft.com/en-us/rest/api/power-bi/imports/post-import-in-group
To replace the report file ( pbix ). 

If I use nameConflict = "CreateOrOverwrite" api create new file with same name. If I use "Overwrite" file doesn't change, but API response "OK". 

Extra info:
New file has connection to other workspace, but next step i rebind to new workspace like previous file. Maybe this is problem?

4 REPLIES 4
jaryszek
Memorable Member
Memorable Member

Did you solve the case? 

It seems that i have similar issue. Overwrite is not replacing report. 

Best,
Jacek

mkiewra
Frequent Visitor

Does it mean that If you have Pro licence and you publish a power bi report by API, it is impossible to overwrite the file in the previous version? Does anybody know any workaround? We want to overwrite the previous file just to retain user permissions, credentials, gateway configuration etc.

 

Any help will be appreciated. 

Anonymous
Not applicable

Hi @Anonymous ,

First, please check if you hit any of following limitations:

  • Dataflows with service principal aren't supported.
  • Importing a Power BI .pbix file from OneDrive isn't supported.

Do you mean the new report file also be referenced by other workspace? If yes, you can view which workspace reference it by lineage view and delete them. Then try to call the rest api again and check if the report can be updated with latest info... 

yingyinr_0-1656321749080.png

Best Regards

Anonymous
Not applicable

Thank for response. 
Limitations is ok.
# Do you mean the new report file also be referenced by other workspace?

Yes and application (powerbi/azure) has admin too on other workspace.

I used API command to push new file. In my target workspace created second file with same name. Old file referenced to workspace in API command, but my new file referenced to other workspace. Next I used this:
https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/Rebind
to connect right workspace. After this i had two files with same name connect inside workspace. 

If I deleted file in target workspace I will lose roles for file  I want to overwrite. I can't get roles from base file, becouse API response I don't had access for this.  Moreover I need overwrite file, becouse if I delete and create new report its couse losing statistic about report. 

If i use Microsoft Power BI page and try import file (referenced to other workspace)  with same name all is good. Page show question about replace, I click ok and report replaced with delete old file and statistic is ok. I expected API to do exactly same job, when i use "Overwrite".




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.