Reverse Creating the PBIP file from Source Control

On my article about Source Control with GIT, Power BI and Microsoft Fabric, I illustrate how to use the PBIP file format to include Power BI reports and semantic models in a source control process and stablish a SDLC (Software Development Lifecycle) for Power BI.

However, the complete explanation is based on saving the development using PBIP format and inserting into source control.

What happens if we do the opposite?

Linking a Workspace to the Repository

Let’s imagine we already have the report and semantic model published on the Power BI portal. Like on the image below

A screenshot of a computer

Description automatically generated

We link the workspace to a repository, sending the content to the repository.

A screenshot of a computer

Description automatically generated

Finally, we clone the repository to our local machine. Each object in the workspace will have its own folder.

A screenshot of a computer

Description automatically generated

How could we open the report and semantic model again in Power BI Desktop?

 

Creating the PBIP File

When we start from Power BI and generate the repository, no PBIP file is generated. In this scenario, we need to generate the PBIP ourselves.

The PBIP structure is very simple. It always points to a report and it’s the report which points to a dataset.

On our example, a PBIP file for LakehouseLocalDS would be like this:

{
   "version": "1.0",
   "artifacts": [
      {
         "report": {
            "path": "LakehouseLocalDS.Report"
         }
      }
   ],
   "settings": {
      "enableAutoRecovery": true
   }
}

On this example we need 3 PBIP files, but as you may be noticing, they are very simple.

A screenshot of a computer

Description automatically generated

Once we create the PBIPs, we can open them in Power BI Desktop and manage the report and semantic model as usual.

It’s interesting to notice the “.gitignore” file is also missing, but once we open a PBIP and save it, even without changing anything, a “.gitignore” file is created.

We need to push these PBIPs to the repository, so any other developer cloning the repository will have the PBIPs available. The portal will, in fact, ignore these files. It shows the objects based on the folders.

It’s also important to notice that some changes to the report made on the portal may create an incompatibility with Power BI Desktop. The features on the portal and the features on the desktop version aren’t always aligned.

Additional Reference

You may would like to watch the video: Fabric Monday 19: Reverse Create the PBIP

Summary

If we start the source control from the workspace instead of the local machine, the PBIP file are not created for you. You need to manually create them in a process I call Reverse Creating the PBIP.