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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
ridabenbouziane
Frequent Visitor

Need Help Changing Data Source of a Semantic Model in Microsoft Fabric

Hello,

 

I'm new to Microsoft Fabric and I need some help.

 

I created a semantic model based on a data warehouse located in Workspace DEV. When I deploy the semantic model to another workspace, for example Workspace TEST, it still remains attached to the original Workspace DEV.

 

How can I change the data source of the semantic model so that it points to the data lake in the test workspace? I couldn't find any solution so far.

 

1 ACCEPTED SOLUTION
ridabenbouziane
Frequent Visitor

Hello,

 

The solution founded and tested is to import the semantic model and modify the following line in the expressions.tmdl file located under yourmodel.SemanticModel\definition: powerquery Copy Edit database = Sql.Database("ciblecnx.datawarehouse.fabric.microsoft.com", "ciblecnx")

 

Procedure:

 

Open your semantic model in Power BI Desktop (latest version). 

ridabenbouziane_0-1746609049123.png

After that, choose the "Modification" option (in Power BI Desktop).

 

ridabenbouziane_1-1746609126624.png

 

Export the project using Project Power BI (PBI Project format)

 

 

 

ridabenbouziane_2-1746609221778.png

 

Choose the export path where your project will be saved (this will generate a folder structure with .pbip and SemanticModel folders).

 

 

 

ridabenbouziane_3-1746609296963.png

After that, you should access:

yourmodel\SemanticModel\definition\expressions.tmdl

ridabenbouziane_4-1746609377504.png

And change the line powerquery Copy code database = Sql.Database("target_server", "target_database") in the expressions.tmdl file with your target database information. After making this change, save and close the file. Then, close all open Power BI projects. Reopen the .pbip file — you will see an interface where you can: Choose the target workspace Set a new semantic model name

ridabenbouziane_5-1746609574471.png

 

best regards

Rida BENBOUZIANE

 

View solution in original post

11 REPLIES 11
ridabenbouziane
Frequent Visitor

Hello,

 

The solution founded and tested is to import the semantic model and modify the following line in the expressions.tmdl file located under yourmodel.SemanticModel\definition: powerquery Copy Edit database = Sql.Database("ciblecnx.datawarehouse.fabric.microsoft.com", "ciblecnx")

 

Procedure:

 

Open your semantic model in Power BI Desktop (latest version). 

ridabenbouziane_0-1746609049123.png

After that, choose the "Modification" option (in Power BI Desktop).

 

ridabenbouziane_1-1746609126624.png

 

Export the project using Project Power BI (PBI Project format)

 

 

 

ridabenbouziane_2-1746609221778.png

 

Choose the export path where your project will be saved (this will generate a folder structure with .pbip and SemanticModel folders).

 

 

 

ridabenbouziane_3-1746609296963.png

After that, you should access:

yourmodel\SemanticModel\definition\expressions.tmdl

ridabenbouziane_4-1746609377504.png

And change the line powerquery Copy code database = Sql.Database("target_server", "target_database") in the expressions.tmdl file with your target database information. After making this change, save and close the file. Then, close all open Power BI projects. Reopen the .pbip file — you will see an interface where you can: Choose the target workspace Set a new semantic model name

ridabenbouziane_5-1746609574471.png

 

best regards

Rida BENBOUZIANE

 

Anonymous
Not applicable

Hi @ridabenbouziane  ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Anonymous
Not applicable

Hi @ridabenbouziane   ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Anonymous
Not applicable

Hi @ridabenbouziane ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

In Microsoft Fabric, when you deploy a semantic model from one workspace to another using deployment pipelines (e.g., from DEV to TEST), the data source doesn’t update automatically, it stays connected to the original source in DEV.

To point the semantic model in TEST to the correct data source, you’ll need to manually update it. If the model was created using Power BI Desktop, open the file, go to Data Source Settings, change the source to the TEST environment, and republish it. If it was created directly in Fabric, you'll need to recreate it in TEST with the correct source. 

 

For more detailed information, please refer to the documentation provided by @lbendlin 

 

I hope this will resolve your issue, if you need any further assistance, feel free to reach out.

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou.

hello @Anonymous 

 

Thank you for your response. Unfortunately, I created it directly in Fabric, so I think I am forced to recreate it in TEST mode. 

Anonymous
Not applicable

Hi @ridabenbouziane ,

Thank you for the confirmation.

 

You're right, currently semantic models created directly in Microsoft Fabric do not support data source redirection between workspaces via deployment pipelines. Therefore, the only available option is to recreate the model in the TEST workspace and connect it to the appropriate data source.

This is a known limitation, for updates on this capability, please refer to the Microsoft Fabric release plan.

 

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou.

Anonymous
Not applicable

Hi @ridabenbouziane   ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

 

Hello,

 

I think I’ve found something that might allow us to make this change. I’m currently testing it by importing the semantic model into the latest version of Power BI Desktop. exported it pbip 

Once inside, you can go to:
yourmodel.SemanticModel\definition\expressions.tmdl

 

DatabaseQuery = let database = Sql.Database("your SQL DB") in

I’m still testing this approach to make sure it works correctly.

 

Best regards,

lbendlin
Super User
Super User

Are these workspaces part of a Deployment Pipeline?

Yes, I have a deployment pipeline with Workspace DEV linked to Workspace TEST. However, after testing by detaching them, the semantic model is still attached to the data warehouse from Workspace DEV.

This document has the latest scope on what is and isn't configurable.

 

The Microsoft Fabric deployment pipelines process - Microsoft Fabric | Microsoft Learn

Helpful resources

Announcements
June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.