Forum Discussion
Change Semantic model
i am using two workspaces test and prod for power bi, one of the report in prod workspace is pointing to semantic model located on test workspace instead of pointing on to prod semantic model, the report is used in app, if i change the semantic model of the report from test to prod then will it change the report id, i do not want to change the report id used in app, if yes then is there a better way to switch underlying semantic of report from test to prod without changing the report id? The report is pointing to live semantic model on test workspace
3 Replies
- MFelix
Super User
Hi powerbiexpert22 ,
Taking into account what you explained I assume that you are referring to a thin report that you create from a semantic model publish in this case to DEV.
To make this change you just need to go to the Report and change the semantic model that is connected to it just go follow this steps:
- Open report in Power BI Desktop
- Transform Data
- Data Source Settings
- Select the semantic model and change to the new one
- Save and publish to the prod workspace
You can also do this using using rest api or Power BI Studio (an add-on of visual studio code) editing the definition on the file itself.
- powerbiexpert22
Impactful Individual
Hi MFelix , The report is pointing to live semantic model on test workspace
- SamInogic
Super User
Hi,
You can change the semantic model connected to an existing Power BI report without changing the Report ID.
Power BI supports this through a process called Rebinding.
1. Recommended approach: Rebind Report REST API
Since your report is already published in the Production workspace and is being used in a Power BI App, I would recommend using the Power BI REST API to rebind it.
API endpoint:
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/Rebind
Request body:
{ "datasetId": "PROD_SEMANTIC_MODEL_ID"}
Where:
- groupId = Production workspace ID.
- reportId = Existing report ID in Production.
- datasetId = Semantic model ID from Production.
Important: The API changes the semantic model connection of the existing report. It does not create a new report, so the existing Report ID remains unchanged.
Microsoft Learn
2. Required permissions
You need:
- Write permission on the existing Production report.
- Build permission on the target Production semantic model.
- Appropriate access to the target workspace.
Since the existing report is being rebound rather than deleted and recreated:
- Report ID remains the same.
- Report URL remains the same.
- Existing App report reference remains intact.
- Users can continue accessing the report through the existing App.
However, validate the report after rebinding. The target semantic model should have compatible table names, column names, measures and data types. Otherwise, some visuals may break.
3. Alternative Option: Deployment Pipelines
If you regularly promote reports and semantic models across Dev, Test and Prod, consider using Power BI Deployment Pipelines.
Deployment pipelines support maintaining item IDs when overwriting existing items in the target stage, and can automatically bind reports to corresponding semantic models in the target stage.
Check below links for more details
- Power BI REST API – Rebind Report In Group
- Power BI REST API – Rebind Report
- Microsoft Learn – Deployment pipelines process
To conclude, for your current requirement, use the Rebind Report In Group API. It is the simplest approach because you only need to change the underlying semantic model while preserving the existing Production report and its ID.
Hope this helps!Thanks