Using Git integration with Power BI Desktop

Erik Hamoen
3 min readJun 13, 2023

With the June update of Power BI Desktop, a new preview feature arrived: the .pbip save option. This will create a Power BI project, just like how it is created when you link a workspace to Git, as described in my previous post. In this blog post, I’ll show you how it works.

First things first

First, enable the preview feature in Power BI Desktop, by going to File, Options and settings, Options, Preview features, and then enable Power BI Project (.pbip) save option. If you don’t see this option, you’re probably not on the June 2023 version.

In Azure DevOps, go to Repos and select the Repo you want. I will use the same one as in my previous blog (Analytics Deepdive), and create a new branch. I named mine EKH-PBIP:

Now select the Clone option:

And select Clone in VS Code (or any other IDE you prefer):

After selecting a folder in your explorer, it will start synchronizing and pull all the data in.

Let’s commit something

The next thing is to create a Power BI report. For testing purposes, I just load 3 rows of data, and create a small report.

Instead of saving the report as a traditional .pbix file, go to File, Save As, browse to your folder connected to Git, and select the *.pbip extension at the Save as type:

Inside VS Code, you will now see some pending changes which can be committed:

Now you need to add a comment and you can commit your changes. By selecting the down arrow at the right we can select how we want to commit:

With just Commit, we save the changes locally. With Commit & Push, we save the changes locally and push it to Azure DevOps. With Commit & Sync, we check if there are any new changes in Azure DevOps, pull them first, and then Push our changes.

In this case, I select Commit & Push.

Back to Azure DevOps, where we will see our new report as well:

Now we go to the Power BI Service, and open our Test workspace:

Here we see that Source control has two new updates, and it turns out to be two new files (the dataset and the report). And after selecting the “Update all” button, new files are added to the workspace:

Remember, without data, so first refresh the dataset to view your report.

Round up

The Git integration within Power BI is something we have been waiting for, for so many years, and it’s finally here. And it works amazingly.

Take care.

Originally published at http://sidequests.blog on June 13, 2023.

--

--