Forum Discussion

Power_Be_Eye's avatar
Power_Be_Eye
New Member
6 months ago
Solved

How to Transfer DAX Measures, Calculated Columns, and Relationships Between Two Power BI Datasets

Hi everyone,

I have two Power BI datasets that contain the same tables with identical names. I would like to copy all calculated columns, measures (DAX), and the table relationships from one dataset to the other.

Is there a way to automate this process—using a tool, script, or external utility—or do I need to recreate everything manually?

Thanks in advance for any advice!

  • Tabular Editor is generally safe from a data-security perspective when used normally. It works primarily with model metadata, not the underlying data.

  • Power_Be_Eye some other optons you can consider too..

     

    ALM toolkit.  

    This tool compares two datasets and lets you:

    • See differences

    • Select what to deploy between them

    • Push only measures / relationships / columns

    Again, requires XMLA endpoint.

     

    Lastly, TMDL view.

    If you're using the newer model format:

    1. Open the source PBIX

    2. Go to TMDL View

    3. Copy the model definition files

    4. Paste into the target model

    Sharing for reference , HTH.

  • You can use TMDL

    Paste that into the TMDL view of the other dataset. This will overwrite existing tables and columns and create any new ones that don’t yet exist. Before clicking Apply, remove all lineage tag lines. For calculated columns and measures that exist in the source but not in the target dataset, those will be removed so handling them will require a fairly manual process.

     

9 Replies

  • If the target dataset is in a workspace that supports XMLA read/write (Premium/Fabric capacity or PPU), you can use Tabular Editor:

    • Connect Tabular Editor to Dataset A

    • Connect Tabular Editor to Dataset B

    • Copy/paste:

      • Measures

      • Calculated columns

      • Calculation groups

      • Relationships

      • Roles / partitions (depending on compatibility)

    • Or use Advanced Scripting to export/import model objects

     

    If you cannot work with XMLA read/write, you can still use with via using desktop versions(.pbix) of the models.

    • Power_Be_Eye's avatar
      Power_Be_Eye
      New Member

      Thanks for the detailed explanation — that helps a lot!

      I have one more question regarding Tabular Editor.
      Is it considered safe to use from a data‑security perspective?

      Specifically:

      • Does Tabular Editor access or extract any of the underlying data from the dataset, or does it only interact with the metadata (model, measures, relationships, etc.)?
      • Does any information get sent outside my environment, or is everything handled locally when connected via XMLA?

      Just want to make sure it’s secure before using it in a production workspace.

      Thanks!

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

        Tabular Editor is generally safe from a data-security perspective when used normally. It works primarily with model metadata, not the underlying data.

  • Power_Be_Eye some other optons you can consider too..

     

    ALM toolkit.  

    This tool compares two datasets and lets you:

    • See differences

    • Select what to deploy between them

    • Push only measures / relationships / columns

    Again, requires XMLA endpoint.

     

    Lastly, TMDL view.

    If you're using the newer model format:

    1. Open the source PBIX

    2. Go to TMDL View

    3. Copy the model definition files

    4. Paste into the target model

    Sharing for reference , HTH.

  • You can use TMDL

    Paste that into the TMDL view of the other dataset. This will overwrite existing tables and columns and create any new ones that don’t yet exist. Before clicking Apply, remove all lineage tag lines. For calculated columns and measures that exist in the source but not in the target dataset, those will be removed so handling them will require a fairly manual process.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Power_Be_Eye ,
    Thanks for reaching out to the Microsoft fabric community forum.

    In this case, there isn’t any built in feature inside Power BI Desktop that allows you to directly transfer all measures, calculated columns, and relationships from one dataset to another in bulk. That capability simply doesn’t exist natively in Desktop.

    However, when the workspace is running on Premium capacity or Premium Per User and the XMLA endpoint is enabled with read write access, the semantic model can be accessed and modified using supported external tools. Tools like Tabular Editor connect directly to the dataset metadata through the XMLA endpoint and allow you to copy, paste, script, and deploy model objects such as measures, calculated columns, and relationships. This works at the metadata level and does not extract or move the underlying data itself.


    So for the original scenario where both datasets already contain identical tables and the goal is to transfer only the model logic, using an external tool via XMLA is the correct and supported way to handle it. It meets the requirement of avoiding manual recreation and stays within supported capabilities of the platform.


    Thank you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Power_Be_Eye ,

       

      I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.

      Thank you.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Power_Be_Eye ,

         

        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.

        Thank you.

  • Ray_Minds's avatar
    Ray_Minds
    Icon for Solution Supplier rankSolution Supplier

    ANS:   

    PBIR (Power BI Project) format can significantly help for simplify transferring measures, calculated columns, and relationships between datasets, especially when the tables and schema are identical. Here’s how you can approach this:   

       

    Convert PBIX Files to PBIP   

    • Open your source PBIX in Power BI Desktop.   
    • Go to File → Save As → Power BI Project (.pbip).   
    • Repeat for your target PBIX.   

      This creates a folder structure containing model.bim and individual table JSON files.   

      Transfer Measures    

      • Open definition/tables/<TableName>.json in the source project.   
      • Locate the "measures" section.   
      • Copy the relevant measures and paste them into the corresponding table JSON in the target project.    

        NOTE: Ensure that table and column names exist in the target model, as any missing dependency will cause errors.   

          

        Transfer Calculated Columns   

        • In the same table JSON file, identify columns where "type": "calculated".   
        • Copy and paste these into the corresponding target table.   

          Transfer Relationships   

          • Open definition/model.bim.   
          • Locate the "relationships" array.   
          • Copy the relationships and paste them into the target model.bim.    

            NOTE: Make sure the referenced tables and columns match exactly; otherwise, the model may fail to load.   

               

            Reload the Target Project   

               

            After merging, open the target .pbip in Power BI Desktop. Power BI will rebuild the model with all measures, calculated columns, and relationships intact.   

               

            Considerations   

            1. JSON syntax must remain valid.   
            2. Column and table names must align with the target model.   
            3. IDs and unique identifiers in the model should not conflict.   
            4. For complex calculation groups or large models, validate carefully after merging.     

              Why This Approach Is Recommended   

              1. Bulk copy: Transfer dozens or hundreds of measures at once.   
              2. Version control friendly: PBIR works well with Git or other source control systems.   
              3. Structured and safe: Reduces the risk of manual errors.   
              4. Scalable: Ideal for enterprise environments where multiple datasets share common business logic.