Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hello,
why power bi always when I am changing data source wants to remove my diagramLayout in project file?:
How to avoid this ?
Best,
Jacek
Solved! Go to Solution.
Hi @jaryszek,
Thank you for the follow-up question.
Yes, the report built on top of the newly created semantic model will see the data changes, as long as the semantic model itself is refreshed or reading updated data (for example via DirectLake/OneLake). From a data perspective, everything works as expected.
What changes is only the model identity, not the data behavior. When you create or deploy a new semantic model, reports connected to that model will reflect the latest data, but Power BI treats it as a new model instance. Because of that, editor-specific elements like the model diagram layout don’t carry over, even though the report visuals continue to work normally.
Thanks again for using the Microsoft Fabric Community Forum.
Hii @jaryszek
There is no supported way to prevent this behavior today. The best practice is to commit the PBIP files to source control before changing the data source, or change connections using parameters / environment variables so the model structure doesn’t change, which helps preserve the diagram layout.
Hello,
" The best practice is to commit the PBIP files to source control before changing the data source"
I have already commited files, how this would work?
"change connections using parameters / environment variables so the model structure doesn’t change, which helps preserve the diagram layout."
I am using remote semantic model DirectLake over OneLake, how to add parameters and where to put them?
Best,
Jacek
Hi @jaryszek,
Thanks for reaching out to the Microsoft Fabric Community Forum and the follow-up, that is a fair question. Also, thanks to @rohit1991, for his inputs on this thread.
To clarify, committing PBIP files to source control does not stop Power BI from removing the diagram layout; it only helps you recover the diagramLayout.json file afterward. In the Power BI project format (PBIP), the diagram layout is stored as its own JSON file alongside the semantic model metadata. When the data source or Direct Lake binding changes, Power BI regenerates the semantic model metadata, and the diagram layout is currently reset by design.
Since you are using a remote Direct Lake semantic model over One Lake, parameters or environment variables can’t be applied here because there is no Power Query connection involved. The most reliable approach is to keep One Lake paths, table names, and schemas stable and use One Lake shortcuts to switch environments instead of rebinding the model. Now, there isn’t a supported way to guarantee diagram layout preservation in this scenario.
Refer these links:
1. https://learn.microsoft.com/en-us/power-bi/developer/projects/projects-dataset
2. https://learn.microsoft.com/en-us/power-bi/developer/projects/projects-overview
Hope that clarifies. Let us know if you have any doubts regarding this. We will be happy to help.
Thank you for using the Microsoft Fabric Community Forum.
thanks, can I handle it using jsut git ignore or some other git feature?
Please explain more step by step:
"The most reliable approach is to keep One Lake paths, table names, and schemas stable and use One Lake shortcuts to switch environments instead of rebinding the model. "
What kind of environments you are talking about?
the model is : onelake ->semantic model -> report as bpip project connecting to remote model.
Where I will implement the Lakehouse shortcut and how it can work? (do not send me to docs, I know already them, they are too general).
Best,
Jacek
Hi @jaryszek,
Thanks for the detailed follow-up, these are good questions.
Git (including .gitignore) unfortunately will not solve this. Git can help you restore diagramLayout.json after it’s removed, but it cannot prevent Power BI from dropping the layout when the semantic model metadata changes. That behaviour happens before Git is even involved.
When I mentioned environments, I was not referring to different semantic models or rebinding reports. I meant different data environments behind One Lake (Dev/Test/Prod data). The idea is to keep the Direct Lake semantic model and Lakehouse constant and only switch the data source behind it using One Lake shortcuts.
Practically, this means creating one Lakehouse that your semantic model always points to, and inside that Lakehouse, using table-level shortcuts. When you need to move between environments, you update where the shortcut points (for example, from Dev data to Prod data). From Power BI’s perspective, nothing structural changes same Lakehouse, same tables, same schema so the model isn’t regenerated and the diagram layout is preserved.
At this movement, this is the most reliable approach to reduce layout loss when working with Direct Lake models. There’s currently no supported method to keep the layout fixed if the semantic model is rebound or recreated.
Thank you for using the Microsoft Fabric Community Forum.
Thank you.
"but it cannot prevent Power BI from dropping the layout when the semantic model metadata changes"
ok so when I am deploying (creating a new copy of semantic model to have a possibility to maintain different versions) it will always update metadata ?
There is even a rest api to post semantic model into different workspace...
Hi @jaryszek,
Thanks for the follow-up question.
Yes, when you deploy or create a new copy of a semantic model, the metadata is always regenerated. Even if the model is created from the same definition, via deployment pipelines or REST APIs, Power BI treats it as a new semantic model instance, assigns new internal identifiers, and the diagram layout is reset as part of that process.
Deployment pipelines and REST APIs are meant for promoting or versioning semantic models, but they don’t preserve editor-specific artifacts like the model diagram layout. Any approach that creates a new semantic model (copy, deploy, rebind) will update metadata and drop the layout. If keeping the layout is important, the only reliable option today is to keep a single semantic model stable and change only the data behind it (for example using OneLake shortcuts). There’s currently no supported way to version semantic models and retain the diagram layout across versions.
Thanks again for using the Microsoft Fabric Community Forum.
Ok, one more thing. So report build on top of newly created semantic model still will see the changes right?
Hi @jaryszek,
Thank you for the follow-up question.
Yes, the report built on top of the newly created semantic model will see the data changes, as long as the semantic model itself is refreshed or reading updated data (for example via DirectLake/OneLake). From a data perspective, everything works as expected.
What changes is only the model identity, not the data behavior. When you create or deploy a new semantic model, reports connected to that model will reflect the latest data, but Power BI treats it as a new model instance. Because of that, editor-specific elements like the model diagram layout don’t carry over, even though the report visuals continue to work normally.
Thanks again for using the Microsoft Fabric Community Forum.
Hi @jaryszek,
Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.
Thank you.
Hi @jaryszek,
Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.
Thank you.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 65 | |
| 45 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 115 | |
| 114 | |
| 38 | |
| 36 | |
| 26 |