# Download PBIX for Report created in Service

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-d37e77801d81bc9fbc34318d071085cf7514b79d%2Fdownload-pbix-report-created-in-service-222152.png?alt=media\&token=7e50b970-a0e9-4881-ba32-1f1e94e3a71c)

*I've been there many times myself, and I have witnessed other people having the problem: The ability to create a new report directly in Power BI Service, connected to an existing dataset, is very powerful for its agility.*

*It comes with a huge limitation, though: **The resulting report cannot be downloaded as a PBIX file**, hence cannot be edited further in Power BI Desktop, or shared or archived as a file. Sometimes, new users aren't even aware of this, invest a lot of time and energy into building beautiful reports directly in the browser, only to realize later that they are now locked in.*

Here is the same problem reported in a Power BI Community Forum:

* [Can't download .pbix from report on service](https://community.powerbi.com/t5/Service/Can-t-download-pbix-from-report-on-service/td-p/854601)

**This article gives you a solution which works for anyone without any advanced technical skills.** It is based on two important insights:

{% hint style="info" %}

1. For a report to be downloadable as a .pbix file, it must have been created in Power BI Desktop originally.
2. The `Update Report Content` API allows to swap the contents of any two reports in Power BI Service, provided they are connected to the same dataset.
   {% endhint %}

Putting those two points together, we can come up with this process to download a report PBIX that was previously blocked from being downloaded:

1. Report `A` has been created from dataset `B` in Power BI Service, and cannot be downloaded.
2. In Power BI Desktop, create a new report `C` connected to the same dataset `B`, leave it otherwise empty, and upload it to the same workspace. This report **can** subsequently be downloaded as a .pbix file, even once edits have been made to it in the Service.
3. Use the [Update Report Content API](https://docs.microsoft.com/rest/api/power-bi/reports/updatereportcontentingroup) - which can be triggered interactively on that docs page - to update report `C` with the contents of report `A`.
4. Download report `C`, now containing all the pages, filters and visuals from the original report `A`, and make further edits in Power BI Desktop.

## Using the *Update Report Content* API

The API requires a POST request to be made to this url: `https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/UpdateReportContent`.

`{groupId}` and `{reportId}` represent the report **to be updated**. In our case that is the one we've uploaded as an empty/dummy report from Power BI Desktop, report `C`.

The request must be made with a json body like this:

```javascript
{
  "sourceReport": {
    "sourceReportId": "8e4d5880-81d6-4804-ab97-054665050799",
    "sourceWorkspaceId": "2f42a406-a075-4a15-bbf2-97ef958c94cb"
  },
  "sourceType": "ExistingReport"
}
```

That describes the report the content is coming from, in our case report `A`. *`"sourceType": "ExistingReport"`* always has to be specified exactly like that.

If both reports are in the same workspace, `sourceWorkspaceId` does not need to provided, which simplifies the format further:

```javascript
{
  "sourceReport": {
    "sourceReportId": "8e4d5880-81d6-4804-ab97-054665050799"
  },
  "sourceType": "ExistingReport"
}
```

Let's start by collecting the necessary information. There are two reports in my workspace - one *Created in Service*, which cannot be downloaded, one *Created in PBI Desktop*, which can be downloaded:

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-eb2c72645179f08a1ea199d2da31c0e4ae31bfb8%2Fdownload-pbix-report-created-in-service-230017.png?alt=media\&token=c49a9cad-b012-4b85-bbdf-1e0ea7a061ca)

The *Created in PBI Desktop* report is the one to be updated. Its url is: `https://app.powerbi.com/groups/7e2f5035-afa4-49c9-8a6d-9c5fdff2245d/reports/d7de9a81-ab33-48d1-b124-0305e4a9276f/ReportSection`.

Hence, I can extract:

* `groupId` = `7e2f5035-afa4-49c9-8a6d-9c5fdff2245d`
* `reportId` = `d7de9a81-ab33-48d1-b124-0305e4a9276f`

The *Created in Service* report is the source report, and its url is: `https://app.powerbi.com/groups/7e2f5035-afa4-49c9-8a6d-9c5fdff2245d/reports/51a1cd5d-78b7-434c-8268-08d3c63882a4/ReportSection`.

That gives me:

* `sourceReportId` = `51a1cd5d-78b7-434c-8268-08d3c63882a4`

## Invoking the *Update Report Content* API interactively

Let's navigate to the API Docs page for [Update Report Content](https://docs.microsoft.com/rest/api/power-bi/reports/updatereportcontentingroup). It has that really useful green "Try It" button:

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-ea81f8216892ed948f0d9f3338badd492d8aaab2%2Fdownload-pbix-report-created-in-service-230743.png?alt=media\&token=c60fa62d-6b28-4497-92d1-c7ad579cff36)

Clicking this opens a new panel on the right with a *Sign in* button. Use that to sign in with your Power BI account:

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-a25d93c8b75f8d617f037d5f5ea0378964913eb7%2Fdownload-pbix-report-created-in-service-230933.png?alt=media\&token=52414aba-217c-4581-9f17-a3d8c94f8610)

Then, simply fill in the parameters collected earlier:

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-90d99f2bc991bd675814433eec988d086674503c%2Fdownload-pbix-report-created-in-service-231252.png?alt=media\&token=7a578c70-17c2-4c57-a251-92afa6e2f5ca)

...and click the green "Run" button below:

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-831ff3f57998f4ca375b93a30e871d23062e0b84%2Fdownload-pbix-report-created-in-service-231334.png?alt=media\&token=068f9a74-3a15-475e-b761-13c939dd7714)

If everything went well, "Response Code: 200" will be reported:

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-5b19480119d077de8649fce145a76206eeb7da8d%2Fdownload-pbix-report-created-in-service-231459.png?alt=media\&token=b1f06a8d-30ab-4166-ab09-2b6c8830855a)

I can now open the report `C`, the one uploaded from Power BI Desktop earlier. It has exactly the same contents as report `A`, however, this one can also be downloaded!

![](https://2005413847-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M4ig5W6hPwB57TAOg6q%2Fuploads%2Fgit-blob-e774ffe0809fb393c1ea6cc52a97c2c9f2a52d67%2Fdownload-pbix-report-created-in-service-231812.png?alt=media\&token=196bbde0-965d-4a17-a5d1-7dc2b9af831d)

Problem solved.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.mthierba.net/power-bi/how-to/download-pbix-report-created-in-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
