Excelgoodies logo +31 97 010285556

LEARN THIS HANDS ON

Power BI Reporting

. Live Online FILLING FAST
View all upcoming batches
Version Control for Power BI: A Beginner’s Git Guide for Busy Analysts

Version Control for Power BI: A Beginner’s Git Guide for Busy Analysts

Your manager asks, “Can we go back to the version from last Tuesday before finance changed the measures?” and your stomach drops because the only copy you have is Sales Dashboard_v7_FINAL_FINAL.pbix. Version control for Power BI isn’t just for developers; it’s how you stop overwriting each other’s work and confidently roll back bad changes.

This guide walks through a simple, realistic way to put your Power BI work under Git, even if you’ve never touched Git before, using a concrete team scenario and step‑by‑step habits you can adopt this week.


The Scenario: Three Analysts, One Sales Report, Endless Chaos

Picture a typical BI team:

  • 3 analysts
  • 1 core dataset: Sales_Model.pbix
  • 2 main reports: Sales_Overview.pbix and Account_Details.pbix
  • Shared workspace in Power BI Service

How they work today:

  • Files live in a shared drive or Teams folder.
  • Everyone downloads the PBIX, makes changes, and publishes.
  • File names look like:
    • Sales_Model_v3.pbix
    • Sales_Model_v3_JanUpdate.pbix
    • Sales_Model_v3_JanUpdate_NEW.pbix
  • Nobody is fully sure which version is in production.
  • When a bug appears, they guess which PBIX to open.

The goal: use Git to track changes to models, DAX, and Power Query so the team can:

  • See who changed what and when
  • Safely experiment without breaking production
  • Revert to a known good version

Without turning analysts into full‑time developers.


What Git Actually Solves for Power BI Teams

For this scenario, Git gives you four concrete benefits:

  1. History

    • Every change is saved with a message: “Added new Gross Margin measure”.
    • You can see the sequence of edits over time.
  2. Backup with context

    • It’s not just a copy of the file; it’s a copy plus the story of why it changed.
  3. Safe experimentation

    • You can create a branch like feature/new-discount-logic and test it.
    • If it fails, you delete the branch; main report stays clean.
  4. Collaboration

    • Two analysts can work on related pieces without stepping on each other.
    • Git helps you spot conflicting changes early.

The catch: PBIX files are binary, so Git can’t show a line‑by‑line diff of DAX or queries inside them. We’ll work around that by:

  • Storing PBIX files in Git for versioned snapshots
  • Extracting DAX and Power Query into text files that Git can diff

Step 1: Set Up a Git Repo Without Getting Fancy

You don’t need to learn the entire Git universe. For our team, the first target is a simple structure like:

sales-bi-project/
  Sales_Model.pbix
  Sales_Overview.pbix
  Account_Details.pbix
  dax/
    measures_sales_model.dax
  powerquery/
    queries_sales_model.m.pq
  docs/
    README.md

1. Install the tools

  • Git: install from the official site.
  • Git client: pick one with a GUI (e.g., GitHub Desktop, Sourcetree, or the Git integration in VS Code).

2. Create the repo

  1. Create a folder sales-bi-project on your machine.
  2. Move your main PBIX files into it.
  3. Use your Git client to:
    • Initialize a new repository in that folder.
    • Make the first commit with message: Initial commit: add core PBIX files.

3. Ignore temp and cache files

Create a .gitignore file to avoid clutter:

# Power BI autosave and temp
~$*.pbix
*.tmp
*.bak

# OS-specific files
.DS_Store
Thumbs.db

Now your PBIXs are under version control. It’s still just snapshots, but it’s already better than FINAL_FINAL.pbix.


Step 2: Get Your DAX and Queries into Text Files

This is where Git becomes useful for actual analysis work.

Why bother extracting?

In our sales team scenario:

  • Analyst A changes a measure: Total Sales.
  • Analyst B changes a relationship and a dimension.

With PBIX only, Git just sees “file changed”. With extracted DAX and M scripts, Git can show:

  • Exactly which measure changed
  • Which query was altered

1. Export DAX measures

Use tools like Tabular Editor or DAX Studio to export measures. The idea is to create a .dax file with your model’s measures.

Example of a measures_sales_model.dax file:

-- Sales_Model measures

Total Sales =
    SUM ( 'FactSales'[SalesAmount] )

Total Cost =
    SUM ( 'FactSales'[CostAmount] )

Gross Margin =
    [Total Sales] - [Total Cost]

Gross Margin % =
    DIVIDE ( [Gross Margin], [Total Sales] )

Save this file under dax/ and commit it.

2. Export Power Query (M) scripts

In Power BI Desktop:

  1. Open Power Query Editor.
  2. For each important query:
    • View the Advanced Editor.
    • Copy the M code into a .m.pq file.

Example queries_sales_model.m.pq:

let
    Source = Sql.Database("SQLSERVER01", "SalesDW"),
    dbo_FactSales = Source{[Schema="dbo",Item="FactSales"]}[Data],
    FilteredRows = Table.SelectRows(dbo_FactSales, each [OrderDate] >= #date(2023, 1, 1)),
    ChangedTypes = Table.TransformColumnTypes(FilteredRows,
        {{"OrderDate", type date},
         {"SalesAmount", type number},
         {"CostAmount", type number}})
in
    ChangedTypes

Save this under powerquery/ and commit.

From now on, every time the team changes a measure or key query, they:

  1. Update PBIX.
  2. Re‑export DAX/queries.
  3. Commit the text files.

Git will show meaningful diffs like:

-Gross Margin % =
-    DIVIDE ( [Gross Margin], [Total Sales] )
+Gross Margin % =
+    DIVIDE ( [Gross Margin], [Total Sales], 0 )

Now you can answer “What changed?” in seconds.


Step 3: A Minimal Git Workflow for Analysts

You don’t need branching strategies with fancy names. Start with a simple flow.

Roles in our scenario

  • Analyst A: owns the data model (Sales_Model.pbix)
  • Analyst B: owns the overview report
  • Analyst C: owns the account details report

Daily workflow

For each change:

  1. Pull latest changes from the remote repo

    • In your Git client: Pull or Fetch + Pull.
  2. Open the PBIX you own

    • Make your changes (new measure, new visual, etc.).
  3. Sync DAX/queries

    • Export updated measures/queries to the dax/ and powerquery/ folders.
  4. Review diff in your Git client

    • Check the changes in text files.
    • Make sure you’re not accidentally deleting someone else’s work.
  5. Commit with a clear message

    • Examples:
      • Add Gross Margin % measure and update Sales overview visuals
      • Filter FactSales to current year only
  6. Push to the remote repo

    • So the rest of the team gets your changes.

Commit message patterns that actually help

Use a simple, consistent pattern:

  • Add ... for new measures/queries
  • Update ... for logic changes
  • Fix ... for bug fixes
  • Refactor ... for clean‑up / re‑structuring

For example:

  • Add Discount % measure for Sales overview
  • Update Gross Margin % to handle zero sales
  • Fix relationship between DimDate and FactSales

Later, when someone asks “When did we change the discount logic?”, you can search commit messages instead of hunting through old PBIX copies.


Step 4: Simple Branching Without Confusing Everyone

Once the team is comfortable with basic commits and pushes, introduce one branching rule to protect your main line.

Branch model

  • main (or master): always the version that matches production.
  • Feature branches: one per change or mini‑project.

Example feature branches:

  • feature/new-discount-logic
  • feature/add-customer-segmentation

How the sales team uses branches

Say the manager wants a new “High‑Risk Accounts” page:

  1. Analyst C creates a branch:

    • In Git client: Create branch from main → feature/high-risk-accounts-page.
  2. Analyst C works only in this branch:

    • Edits Account_Details.pbix.
    • Adds new measures in measures_sales_model.dax.
    • Commits changes with clear messages.
  3. When tested and approved:

    • Merge feature/high-risk-accounts-page into main via the Git client.
    • Publish PBIX from the main version.
  4. If the experiment fails:

    • Delete the feature branch.
    • main stayed clean the whole time.

This is enough branching for most analyst teams: one stable branch, temporary branches for bigger changes.


Step 5: When Two People Touch the Same Thing

Eventually, the team will collide on the same measure or query.

Example: Analyst A and Analyst B both change Gross Margin % on different branches.

When merging, Git shows a conflict in measures_sales_model.dax. You’ll see something like:

<<<<<<< HEAD
Gross Margin % =
    DIVIDE ( [Gross Margin], [Total Sales], 0 )
=======
Gross Margin % =
    DIVIDE ( [Gross Margin], [Total Sales] ) * 100
>>>>>>> feature/format-gross-margin-percent

This means:

  • HEAD = version from your current branch.
  • The other side = version from the branch you’re merging.

How to resolve, step by step:

  1. Talk to the other analyst: what’s the intended behavior?
  2. Decide on the final definition, e.g.:
Gross Margin % =
    DIVIDE ( [Gross Margin], [Total Sales], 0 )
  1. Replace the whole conflict block with the agreed definition.
  2. Mark the conflict as resolved in your Git client.
  3. Commit the merge.

The key habit: don’t guess. A 2‑minute chat beats silently picking one version.


Step 6: Connecting Git Versions to Power BI Service

You still publish to Power BI Service, but now you do it from a known commit.

Practical pattern for the sales team:

  1. Only publish PBIXs from the main branch.
  2. Before publishing:
    • Pull latest changes.
    • Open the PBIX from the repo folder.
    • Verify key visuals.
  3. Publish to the correct workspace.
  4. Tag the commit in Git (optional but useful):
    • Tag name example: release/2024-02-15-sales-model.

When production breaks, you can:

  • Find the tag for the last good release.
  • Check out that commit.
  • Re‑publish the PBIX.

No more digging through network drives for “the old version that worked”.


Step 7: A Simple Checklist to Make This Stick

For a team new to Git, consistency matters more than perfection. Agree on these basics:

Every change to a model or report should:

  1. Start from a Pull of the latest main.
  2. Be done in a branch for anything more than a tiny fix.
  3. Export updated DAX and queries to text files.
  4. Have a clear commit message.
  5. Be merged only after at least one other person has:
    • Looked at the diff
    • Opened the PBIX and spot‑checked key visuals

Pin this in your Teams channel or on a wall near the team.


One Practical Takeaway: Start with Just Two Habits

You don’t need to roll out a perfect Git process on day one. For the next week, focus on just two habits for your Power BI work:

  1. All PBIX files live in a Git repo, not on a random shared drive.
  2. All DAX measures and key Power Query scripts are exported to text files and committed with every change.

Once those are automatic, branching and tags become much easier to add. Even this minimal setup will already save your team from mystery bugs, lost work, and the endless v7_FINAL_FINAL.pbix cycle.

Editor's Note

This article reflects how small BI teams can move from ad hoc Power BI file sharing to basic Git-backed version control, especially in environments where multiple analysts collaborate on shared models and reports.

Professionals who want to apply these patterns to their own data can explore Excelgoodies' Power BI Reporting programme - taught live by instructors, with certification awarded once a real project is running at work.

Insights compiled through ongoing industry research and discussions within the Excelgoodies Analytics Community.

Power BI

New

Next Batches Now Live

Power BIPower BI
SQLSQL
Power AppsPower Apps
Power AutomatePower Automate
Microsoft FabricMicrosoft Fabrics
AzureAzure Data Engineering
Explore Dates & Reserve Your Spot → Reserve Your Spot →