Skip to content

Upgrading an existing Power BI Project to include TMDL file format

Reading Time: 6 minutes

In this post I want to cover upgrading an existing an existing Power BI Project to include the TMDL file format. Which is considered to be a more human-friendly format.

Plus, how to get the pipeline provided in the Power BI Project (PBIP) and Azure DevOps build pipelines for continuous integration guide to work with TMDL. Which performs checks using both Tabular Editor 2 and PBI-Inspector.

To clarify, when I say TMDL I mean the Tabular Model Definition Language semantic file format.

Which I mentioned in my post about deploying to Development, Test and Production environments. Since you can now save Power BI Projects that contain this file format in Power BI Desktop.

Along the way I share plenty of links.

Before I go any further, I must highlight that both Power BI Projects and the TMDL file format are both in preview. Which means that the contents of this post are subject to change.

Before upgrading the Power BI Project to include TMDL file format

Before I upgraded an existing Power BI Project, I did the below steps. To allow me to test upgrading with a totally separate copy.

Feel free to check my Microsoft Fabric Git integration jargon guide for Fabricators post to help with any jargon.

  1. I improved my existing report based on some of the warnings I received whilst doing performance tests. To improve the report I used both Power BI Desktop and Tabular Editor.
  2. Imported the Git repository I worked with in previous posts into a new Git repository in the Azure Repos service in Azure DevOps.
  3. Created a new development workspace and linked it to the Dev branch of the newly imported repository. Adding the data source credentials where required.
  4. Created a second workspace to represent a production workspace and linked it to the main branch of the newly imported repository. Adding the data source credentials where required.
  5. Created a new pipeline in Azure Pipelines. Choosing to use an existing YAML pipeline and selecting the version in the main branch of the imported repository.
  6. Configured the build validation for the main branch to use the new pipeline. As documented in the “Define branch policies” section of the Power BI Project (PBIP) and Azure DevOps build pipelines for continuous integration guide.
  7. Setup a deployment pipeline. With the new development workspace assigned to the development stage and two new workspaces assigned to the Test and Production stages.
  8. Cloned (copied) the imported repository onto my laptop.

After doing the above, I was ready to upgrade and test TMDL functionality.

Upgrading an existing Power BI Project

It is relatively easy to upgrade an existing Power BI Project.

First, I made sure that the Preview feature to store semantic model using TMDL format was enabled in Power BI Desktop.

Option to enable semantic model using TMDL format
Option to enable semantic model using TMDL format

Just so that everybody is aware, when you first enable the Tabular Model Definition Language (TMDL) format feature in Power BI Desktop you must restart it.

Anyway, after checking I went to save the Power BI Project and was straight away greeted with the below prompt to upgrade my semantic model format into TMDL.

Prompt to upgrade your semantic model format into TMDL
Prompt to upgrade your semantic model format into TMDL

So, I selected to upgrade. I then went into Visual Studio Code to look at the new folder structure.

New TMDL folder structure after upgrading an existing Power BI Project to include TMDL file format
New TMDL folder structure

When compared to the older Power BI Project structure for the Dataset folder I can see that the model.bim file has been replaced with a definition folder.

Older Power BI Project folder structure
Older Power BI Project folder structure

I like this new structure for various reasons. Including the fact that I think that it makes Power BI Projects more aligned with Database Projects.

Anyway, after checking Visual Studio Code I synchronized the Dev branch for the Git repository with the one in Azure Repos. Now it was time to test Git integration and the Continuous Integration setup.

Testing TMDL with Git integration and CI

After synchronizing my repository with Azure Repos I went into the workspace that has linked to the Dev branch. As you can see below, the Source control highlighted that there were updates.

Microsoft Fabric Workspace recognized changes
Workspace recognized changes

So, I went into Source control and approved the updates. I then opened up the report to check that all was well.

Report worked after updates
Report worked after updates

Pull request for the new TMDL file format

Next, I attempted to perform a pull request from the Dev branch to the main branch. It failed stating that a file was not found. Because the pipeline used to perform the Continuous Integration (CI) test still referenced the model.bim file.

So, I edited the YAML pipeline in the main branch.

In the original pipeline there is a task that runs a PowerShell script that utilizes Tabular Editor to run the Best Practices Analyzer. In PowerShell script it refers to the model.bim file.

$itemPath = "$($itemFolder.Directory.FullName)\Model.bim"

So, I changed that line to the below so that it would scan all the contents of the definition folder instead.

$itemPath = "$($itemFolder.Directory.FullName)\definition" 

As you can see in the CI/CD scripts for Tabular Editor 2’s CLI guide by Daniel Otykier (l/x) this is a perfectly valid thing to do. Anyway, after making the change I ran the pipeline, and I got a file not found error.

This is due to the fact that even though the pipeline YAML file had been updated, the merge had not initially taken place. Which meant that the main branch still contained the model.bim file instead of the new definition folder.

Therefore, the pipeline could not find the new definition folder that was stated in the YAML file. So, I went into the Branch policies for the main branch and temporarily disabled the Build validation.

Build Validation in Branch policies
Build Validation in Branch policies

I then created a pull request to merge the contents of the Dev branch into the main branch. In order for the main branch to contain the new definition folder.

Once done, I ran another pull request which completed. Due to the fact that the updated pipeline was now able to query the contents of the definition folder in the main branch.

Completed pipeline with two warnings after upgrading an existing Power BI Project to include TMDL file format
Completed pull request

Completed pipeline

I then viewed into the completed pipeline run to check that it had some warnings. As you can see below, I had two warnings. Which I left on-purpose to confirm that the Best Practice Analyzer definitely ran okay.

Completed pipeline with two warnings to confirm that upgrading an existing Power BI Project to include TMDL file format was okay
Completed pipeline with two warnings

Deployment pipeline

After doing this I tested a deployment pipeline. With the workspace connected to the Dev branch being assigned to the Development stage.

My initial tests indicate that upgrading an existing Power BI Project to include TMDL file format works with Deployment Pipelines.

I even went as far as to open up the model in the workspace that was assigned to the Production stage afterwards to check it was the same model. Feel free to test this yourselves.

Final words about upgrading an existing Power BI Project to include TMDL file format

I hope that sharing my experiences of upgrading an existing Power BI Project to include TMDL file format encourages those of you with existing projects to do the same. Plus, encourage others to experiment with the new file format.

In reality, the initial upgrade was relatively easy. In addition, updating the YAML code from the Power BI developer pipeline to update the recommended CI process can be relatively easy as well. As long as you remember to do the initial pull request first.

Of course, if you have any comments or queries about this post feel free to reach out to me.

Published inAzure DevOpsMicrosoft FabricPower BI

7 Comments

  1. Jeroen van Steenbergen Jeroen van Steenbergen

    Thanks Kevin, very useful.
    Question: I see you’re using a premium capacity in the workspace, is that just for the deployment pipelines or is this always a prerequisite when working with TMDL and Power BI projects?

  2. Darwin Darwin

    Hi Kevin,
    I was the guy yesterday asking you the question about TMDL not being synced in DevOps. The reason was that I published it from PBI Desktop and it didn’t work. (before TMDL, I still could publish it using the Publish button in PBI Desktop). But when we do it via VS Code, it works.

    But a question is, it seems to me that when you publish the one with TMDL, you can’t download the report back from PBI Service. It was still the case before TMDL, so it was synced with DevOps (no TMDL at that time yet), but I still could download the pbix file. Have you checked from your side if it works? Thanks!

    • Kevin Chant Kevin Chant

      Hi Darwin,

      I just checked and it appears to be working for ne. Is it definitely a report you created using TMDL and not one created for Direct Lake mode?

      Kind regards

      Kevin

  3. bjarki bjarki

    Did you test with template apps ? did get a warning on that one when uploading a PBIP file with TMDL activated.

Leave a Reply

Your email address will not be published. Required fields are marked *