When you try to implement a split workspace setup (Report workspace and Data workspace) in PowerBI starting from an existing set of reports, you could come across one practical challenge to minimize the impact to the end-users : they have links to your favourite reports which you don’t want to tell them to change.
The existing (single) workspace will be repurposed as the Report workspace (only reports go in this workspace, the dataset move out of it to the Data workspace).
When you have existing reports that point to the dataset in this Report workspace, you need to update these reports to point to the same dataset, but in the Data workspace.
One way to do this is in PowerBI Desktop:
- Ribbon Home, Queries: Transform Data -> Data source settings
- Pick the new dataset
PowerBI updates the report and you source data from the new dataset
but
when publishing this report, you will receive a new shiny report in the PowerBI workspace with exactly the same name, right next to the old one.
This is impractical, as all users will need to be made aware of the new URL of the report, some might have it in their browser favorites, etc.
After struggling with changing the Connections file in the unpacked PBIX (I mean ZIP) file, I still ended up with two reports in the workspace. To
The solution is quite straightforward: you use the PowerBI API.
Reports – Rebind Report In Group – REST API (Power BI Power BI REST APIs) | Microsoft Learn
Basically, you issue a you send a POST request to URL : https://api.powerbi.com/v1.0/myorg/groups/{workspace id}/reports/{report id}/Rebind
In the body, the API expects
{ datasetId: “{dataset id}” }
which is the dataset the report should point to.
(This does not apply to reports in “My workspace”, there is an alternative command for it, Rebind Report)
The workspace id can be found in the URL of the report
The report id can be found in the URL of the report
The dataset id can be found when you open the dataset in the service.
E.g. point the Internet Sales report from dataset Sales in Report Workspace to Data Workspace
- Workspace id (Report Workspace):
https://app.powerbi.com/groups/e3160502-2230-xxxx-xxxx-6bc2fc30fcf4/reports/888d222e-xxxx-xxxx-bfb9-6bc2fc30fcf0/ - Report id (Internet Sales):
https://app.powerbi.com/groups/e3160502-2230-xxxx-xxxx-6bc2fc30fcf4/reports/888d222e-xxxx-xxxx-bfb9-6bc2fc30fcf0/ - datasetId (Sales in Data workspace): various ways, an easy one is to rightclick the dataset and “copy link” :
https://app.powerbi.com/groups/6bc2fc30fcf4-xxxx-xxxx-e3160502-2230/datasets/cbfd30e8-xxxx-xxxx-xxxx-abcde939a31f/
The command becomes:
POST https://api.powerbi.com/v1.0/myorg/groups/e3160502-2230-xxxx-xxxx-6bc2fc30fcf4/reports/888d222e-xxxx-xxxx-bfb9-6bc2fc30fcf0/Rebind
Body: { datasetId: “cbfd30e8-xxxx-xxxx-xxxx-abcde939a31f” }
This can be run in the browser from the API documentation page using “Try It”.