Power Query vs DAX: Where Each Step Belongs
Not sure whether to clean data in Power Query or calculate in DAX? Use this simple rule, with examples for calculated columns, measures and the M language.
Short answer: Save your Power BI work as a Power BI Project (PBIP), so the semantic model becomes plain text files. Put those files in a Git repository on GitHub, and connect an LLM to them. You get version history, reviewable changes and an AI assistant that can draft DAX and M inside a safety net. Every change is a diff you can read, test and undo, which is what turns AI help from a risk into a routine.
For years, Power BI development meant one person, one .pbix file and a folder full of files called Sales_v7_FINAL_fixed.pbix. There was no diff, no code review and no way to see who changed a measure. Two changes in the last few years remove that limit: Power BI can now save models as text, and AI assistants can read and edit text. Put them together and analysts get a workflow that software engineers have used for a long time.
This post explains how the pieces fit, shows the day-to-day workflow, and covers the risks.
A .pbix file is a single binary package. Git can store it, but it cannot show you what changed inside it. Two analysts working on the same model cannot merge their work, and nobody can answer “who changed this measure and why?” without opening old copies.
Microsoft’s Power BI Project format solves the storage problem. According to Microsoft’s documentation, when you save as a Power BI Project, “report and semantic model item definitions are saved as individual plain text files in a simple, intuitive folder structure.” The semantic model folder holds the model definition, the report folder holds the report, and a .gitignore excludes local cache files.
The model itself is written in Tabular Model Definition Language (TMDL), a readable text format. Power BI Desktop also includes a TMDL view, which Microsoft describes as a way to “script, modify, and apply changes to semantic model objects by using a modern code editor,” with a side-by-side diff before you apply changes. Microsoft lists TMDL view in Power BI Desktop as generally available. At the time of writing, the documentation describes Power BI Desktop projects as being in preview, so check the current status before adopting this for critical work.
A measure in a TMDL file looks like this (illustrative example):
table Sales
measure 'Net Revenue' = SUM(Sales[NetAmount])
formatString: #,0
That is ordinary text, which is exactly what Git and an LLM both handle well.
Sources: Power BI Desktop projects (PBIP) and TMDL view in Power BI, Microsoft Learn.
There are two routes, and they can be combined.
| Route | How it works | Good for |
|---|---|---|
| Local PBIP + GitHub repo | Save the project to a local folder, initialise a Git repository, push to GitHub | Individual analysts and small teams starting out |
| Fabric workspace Git integration | Connect a Fabric workspace to a Git repo, so items sync between the workspace and a branch | Teams already publishing to the Fabric or Power BI service |
Microsoft’s Fabric documentation says Git integration lets developers “backup and version their work,” “revert to previous stages as needed,” and “collaborate with others or work alone using Git branches.” It supports GitHub, GitHub Enterprise and Azure DevOps (cloud-based only). Semantic models and reports are among the supported items, though the documentation marks several Power BI item types as preview.
Source: Fabric Git integration overview, Microsoft Learn.
There are three levels, from simplest to most automated.
Sources: Overview of the Power BI MCP servers, microsoft/powerbi-modeling-mcp.
This is my suggested workflow, not an official Microsoft procedure:
feature/net-revenue-measure.+ measure 'Net Revenue' = SUM(Sales[NetAmount]) - SUM(Sales[RefundAmount])
+ formatString: #,0
The same loop works for Power Query M. Ask the assistant to refactor a slow query, for example by moving a filter step earlier, and review the changed lines instead of scrolling through the Advanced Editor.
The evidence here is my own view from years of BI work, not a measured study. I see five shifts.
Microsoft is direct about the risks, and they are worth taking seriously.
That single cycle teaches you most of the workflow.
Do I need Fabric to use Git with Power BI? No. The PBIP format works locally with any Git repository. Fabric Git integration is an extra route for workspaces.
Will the LLM know my data model? Only what it can read. Pointing it at your TMDL files gives it the schema and existing measures, which improves suggestions considerably compared with a blank chat.
Is it safe to let an AI edit my model? It is safer with Git, branches and review, but not risk-free. Follow the guardrails above and check your organisation’s rules on AI tools and data.
Does this work for Power Query M as well as DAX? Yes. M queries are stored as text in the model files, so an assistant can propose changes you review as diffs.
Last reviewed: 20 September 2026.
Part of: Power BI & DAX, AI for Analysts