Setting up Version Control for my Power BI Desktop Files (PBIX) with no additional Cost * | Part 1
I very often hear people asking if it is possible to use Source Control or Version Control with Power BI (PBIX) files, and whilst I was working with a customer this week, I found a way to enable source control.
Wait, wait before you go running off and reading the rest of the blog post, let me first say that there is still a manual process, but I feel that it is not too difficult once I have got it all set up.
In Part 1 I am going to go through the process of configurations and installations in order to be able to Version Control my PBIX files.
In Part 2, I will show you how I do the version control, and find older versions etc.
And YES, the * meant that if you have under 5 users you can do this for free.
Source Control setup using Azure DevOps
The first thing I had to do was to sign up for Azure DevOps
A quick note is that I am by no means an Azure DevOps expert, it is all new to me in terms of setting this up. (If someone has got more information please let me know so that I can update this section)
Did you know that the first 5 users using Azure Dev Ops can use it for free?
Here is the URL I used to sign up: https://azure.microsoft.com/en-au/pricing/details/devops/azure-devops-services/
- I clicked on Start for free.
- I then signed in with my work account
-
I was then prompted to Name my DevOps Organization and set the time zone
- I clicked Continue
-
This then let me know it was busy
-
Once that was completed, I then had to create my first project
- My understanding is that a Project is an area where all the artefacts for that project will stored.
-
I gave my Project the name of Data Analytics
- And then clicked on Create project
- Once completed I was then presented with the following below.
What I found is that in order to get the data into Visual Studio I first had to create a folder in the Repo, which I explain below
- In my project I clicked on Repos
-
I then went to New, clicked on the drop-down arrow and selected Folder
-
I then gave it a Folder Name of Power BI PBIX
- I then clicked on Check in
-
I could now see the folder under my Repos
I now have setup and configured my Azure DevOps
Visual Studio Installation
I am aware that you are no longer limited to only using Visual Studio to connect to Azure DevOps, you can use GIT and a whole host of other version control pieces of software.
Personally, for me, I have been using Visual Studio for a long time, it is where I am comfortable and there is a Free version of Visual Studio that can be used too.
Please note that a reader Daniel highlighted that the use of Visual Studio Community Edition is only available for users with less than 250 users, here is the link for more information: https://visualstudio.microsoft.com/license-terms/mlt031819/
- The free version that I installed was Visual Studio 2019 Community Edition, which I downloaded from here: https://visualstudio.microsoft.com/vs/
-
Once the above page opened, I hovered over Download Visual Studio and selected
- Community 2019
-
This then downloaded the exe file.
- I then opened the file to start the installation
-
I clicked on Continue on the Visual Studio Installer window
- This downloaded the latest Visual Studio installer files.
-
I then left all the defaults and clicked Install on the far-right hand side
-
I was then prompted if I wanted to continue without any workloads, I clicked Continue
-
I could then see my downloading and installation completing
-
Once the installation has been completed, I was then prompted to sign in.
-
I clicked on Sign In
-
I was then prompted to sign in, and I used the same account I used when signing up and created the Azure DevOps project.
-
-
-
I was then prompted with the Visual Studio 2019 screen as shown below.
- I clicked on “Continue without code”
-
I then had Visual Studio 2019 community edition installed.
Connecting & getting Repos from Azure DevOps in Visual Studio 2019 Community
In the steps below I will show you how I connected to Azure DevOps and synced my files.
-
On the bottom right-hand side, I clicked on Team Explorer
-
I then clicked on Connect under Hosted Service Providers
-
This opened the Connect to a Project window
- It then searched in Azure DevOps for Projects that I have access to.
-
I could then see my Project that I had created earlier called Data Analytics
-
I then clicked on $/Data Analytics (Which to me was the Visual Studio connection)
- I then had the Connect button change to blue, which I clicked on Connect
-
-
I could then see that I was connected to Azure DevOps
-
Following on from this I now still need to map a local folder to work on data locally, which I did by doing the following
- I could see at the top that I am prompted to “Configure your workspace”
- I clicked on “Configure your workspace”
- Under the Configure Workspace I had the options as shown below.
-
- The top option is the Project to connect to, as with my example it was $/Data Analytics
-
The second option is where I wanted to map the files to on my local PC
- NOTE: I always suggest changing this to a location where you can easily find the files.
- I clicked on the Ellipses and mapped it as shown below.
-
The Configure Workspace now looked like the following:
- I clicked on Map & Get
- I got confirmation that it was successful
-
I could then see that my data was mapped correctly in the Source Control Explorer
- I now have got Azure DevOps configured
Configuring Azure DevOps to always have a comment when checking in Files
The final step in part 1 of this blog post is to set the options to always enable comments when checking in files
-
I made sure I was on the Team Explorer window
- I then click on Settings
-
Under Team Project, I selected Source Control
-
On the Source Control Settings window, I then clicked on Check-in Policy
-
I then clicked on Add…
- I then selected Changeset Comments Policy
- As you can see above this policy requires that users project check-in comments.
- I personally feel that this is vital for looking at older versions.
- I then clicked Ok
- I could then see the Policy Type and clicked Ok again
Conclusion
In this blog post I have gone through all the steps on how to setup Version Control for Power BI PBIX files using Azure DevOps.
Part 2 of the blog post I will show how I added folders and files into Version Control, check-in the files, check-out files and revert to previous versions. Please stay tuned for the next blog post.
Any comments and suggestions are always welcome.
Thanks for reading!
Thank you so much. Can’t wait for part 2.
Thanks for the kind words, I plan to have it completed by next week.
Why not just use version control in OneDrive?
That certainly can be used, but you do not get the functionality of quickly and easily being able to put in comments and revert back.
Just a note to be careful around the License terms for using VS Community Edtition, it’s a no go if you’re an Enterprise With >250 users:
https://visualstudio.microsoft.com/license-terms/mlt031819/
An unlimited number of users within an organization can use Visual Studio Community for the following scenarios: in a classroom learning environment, for academic research, or for contributing to open source projects.
For all other usage scenarios:
In non-enterprise organizations, up to five users can use Visual Studio Community. In enterprise organizations (meaning those with >250 PCs or >$1 Million US Dollars in annual revenue), no use is permitted beyond the open source, academic research, and classroom learning environment scenarios described above
Hi Daniel,
Thanks for bringing that to my attention, I will update the blog post to reflect this.
Good starting point Gilbert, thanks for sharing with us!
There is one point I would struggle with in case I wanted to implement this approach: the sheer size of .PBIX files as they contain the data as well. An I think VS would consider the structure changed even if you just refresh the dataset because that means the file itself changes, too. With my team we used to export all .pbix to .pbit (template) but it’s cumbersome to do all the time as an additional step.
If you would have any tips about that, I would be glad to hear / read them!
Thanks
My only thought would be to limit the rows returned via a parameter. Which once the report is uploaded could be changed to then import all the data?
Hi Gilbert,
Very useful thanks! I am implementing now. One thing that stopped me (being a newbie) – when starting the project, you need to specify that the Version Control is Team Foundation and not Git, or else you get a very different screen.
Yeah I agree it is a very different screen and for me Team Foundation has been something I have used for years.
Thanks for sharing. =)
No worries glad you found it useful!
What about how to handle the large files with git as it does not like them. We have implemented a way to dump the data from our files so when we check in to source control the files do not have the data to bloat and seems to help resolve, but not sure if there is a better/easier way as we are working to automate our deploy with CICD from Azure DevOps.
The best is to create a Power BI template file. Which will make the size a lot smaller
I am familiar with template, but that requires when you open to have to save the file back as the desired PBIX name, so not as optimal, and then you have to wait for your data to sync, where what we have in our files is a parameter to keep or dump the data in essence. It is used as the last step of transformations for each table, so if the value is set to keep the data it does, otherwise the data is dumped after read in, not efficient, but it works. Then we save the file and check that in.
Hi Gilbert,
Is this method good for the security of the data that the PBI files will be holding?
Very often the developers will get to see all the data in the dataset because they have to work and develop the reports with the right answers.
You could also save them as PBIT so no actual data is stored?
Thank you, I was meaning , other than the developers, can anyone extract the data from outside the organisation since Azure DevOps Service is cloud base?
One more question, can the changes be merged if more tha one person working on one power BI report ? Thank you so much..
If developers have got access to the specific branch in Azure Dev Ops then yes. I know you can control the security.
Currently it is not possible to merge changes on the PBIX. It can only be edited by a single user.
Using Power BI premium would allow for multiple users or the future Premium per user!
Hello Gilbert, I wanted to ask a question
-can this versioning form save a lot of changes?
-I am using Visual Studio community 2022, I already come out connected with Azure, but the workspace configuration and the map & get I don’t understand how to do it, maybe you can explain me if you are so kind.
Hi Monica,
Whilst it can assist, I have found that it can still be a real challenge to get this working well.
We have full CICD working for our environment using the Azure DevOps. This is what we are doing.
1. We have a parameter defined for all our data source connections, so we can change them during the promotion process of the environment.
2. We have a special parameter to basically tell the Power Query to dump all the data if the value is set to not retain the data. This will make the file as small as possible when checked into source control.
3. We have CICD pipelines created so when a new version is checked in to source control (we just use VS Code for this not Visual Studio but we could do that), it will trigger the new build to be deployed.
4. Our CICD is a set of PowerShell scripts to interact with the Power BI service to get the artifact published to the appropriate workspace, as we have a full DEV/QA/STAGE/PROD setup for many of our reports (not all and we handle for when it applies and does not).
So we are very successful to have our Power BI development enhanced to have implemented CICD which is where the configuration of the respective environment is set when it gets to deployed there.
Wow Andrew that is really awesome
I am certain a lot of people would be interested on how to actually do that. I certainly would!
If you are able to share any details please let me know.
Hi,
Can you help me how to Get a Backup in ADO Repository for PBIX Files
Hi Sri
There are some great blog posts on how to do this, I personally have not done this in the past.
How to send the files from DEV to Prod stage (Workspace in power bi service) rather than sending from artifacts.
Requirement is Artifact to DEV and From Dev to Prod.
Hi Nikhil,
This is currently not possible, but it is hopefully possible in the future that the Power BI team will make this happen.