Forum Discussion

jaryszek's avatar
jaryszek
Icon for Super User rankSuper User
7 months ago
Solved

How to not remove Layout Diagram pbip project

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

 

  • 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.

11 Replies

  • 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.

    • jaryszek's avatar
      jaryszek
      Icon for Super User rankSuper User

      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




      • v-kpoloju-msft's avatar
        v-kpoloju-msft
        Icon for Community Support rankCommunity Support

        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.