AI Power BIDAXCopilotClaudeChatGPT

AI-assisted DAX: writing measures with Copilot, ChatGPT and Claude

How to use AI to write, explain and debug DAX measures, with prompts that work, checks to run and common mistakes.

UUIUX Studio Editorial Team 5 min read
AI
AI-assisted DAX: writing measures with Copilot, ChatGPT and Claude
Using AI to write a DAX measure
Write
From definition to measure
Describe the business rule; AI drafts the DAX.
DAX
Revenue YoY % =
DIVIDE([Revenue] - [Revenue PY],
[Revenue PY])
Draft
Test
Check before publishing
Compare against numbers you already trust.
CHECK
✓Known total
✓Blank months
✓Grand total
✓Slicer test
THE SHORT ANSWER

AI tools can write, explain and debug DAX measures well when you give them the model structure: table names, columns, relationships and what the measure should mean. Copilot in Power BI sees your model directly; ChatGPT and Claude need you to paste the relevant parts. AI is good at time intelligence, ranking and explaining existing formulas. It still makes mistakes with filter context, blank handling and business rules, so test every measure against known numbers before publishing.

KEY TAKEAWAYS
  • ✓Give the AI table names, relationships and the business definition
  • ✓Copilot sees your model; general chatbots need context pasted in
  • ✓Good uses: time intelligence, ranking, explaining and refactoring
  • ✓Common errors: filter context, blanks, totals and many-to-many joins
  • ✓Always test a new measure against a number you already trust

Can AI really write DAX?

Yes, for a large share of everyday measures. DAX has a well-documented function library and many public examples, so language models have seen a lot of it. The hard part of DAX is not syntax but context: which filters apply, how tables relate and what the business means by “active customer” or “resolved on time”. AI only gets that right when you tell it.

Which tool should you use?

Tool
Sees your model?
Best for
Copilot in Power BI
Yes, directly
Measures inside Desktop or the service, explaining existing DAX
ChatGPT
No, paste context
Drafting, explaining and refactoring long formulas
Claude
No, paste context
Reviewing complex measures and writing documentation
DAX query view with Copilot
Yes
Writing and testing DAX queries against the model

Copilot in Power BI needs Fabric capacity at F2 or above, or Premium P1 or above; see Copilot in Power BI. For the general assistants, our comparison of ChatGPT, Claude and Gemini covers strengths and pricing.

How do you write a good DAX prompt?

  1. 1
    State the business rule
    For example: “resolved on time means closed before the SLA deadline for its priority”.
  2. 2
    List the tables and columns
    Include data types and which columns are keys.
  3. 3
    Describe relationships
    Which table filters which, one-to-many or many-to-many, and any inactive relationships.
  4. 4
    Say how it should behave
    Under slicers, in totals, and when there is no data.
  5. 5
    Ask for an explanation
    Request a line-by-line explanation so you can review the logic.

Never paste confidential data rows into a public chatbot. Table and column names are usually enough, and your organisation’s AI policy should say which tools are approved. Our AI usage policy template can help.

Where does AI help most?

T
Time intelligence
Year-to-date, previous period, rolling 12 months and year-on-year change.
R
Ranking and top N
RANKX patterns and dynamic top-N with an “others” bucket.
E
Explaining inherited DAX
Turning a 40-line measure into plain English before you change it.
R
Refactoring
Replacing nested IFs with SWITCH, adding variables and DIVIDE.
D
Documentation
Writing measure descriptions, which also help Copilot answer questions.
T
Test queries
Drafting DAX queries that list values so you can check a measure.
Mashreq NEO case study
Case study · Mashreq NEO Executive dashboards and an AI assistant One view of bank performance for leadership, plus an AI assistant that answers questions from internal documents.
1View of bank performance
Power BIReporting
AzureAI platform
View case study →

What mistakes does AI make with DAX?

Where AI-written DAX goes wrong most often
Filter context and CALCULATERemoves or keeps the wrong filters
TotalsRow logic that gives a wrong grand total
Blanks and zerosShows 0 where blank is correct, or the reverse
RelationshipsAssumes a relationship that does not exist
Business rulesUses a plausible but wrong definition
Relative frequency from our own review work, not a published study.

Each of these produces a number that looks reasonable, which is why testing matters more than reading the code.

How do you test an AI-written measure?

  1. 1
    Compare with a trusted number
    Check one month or one region against a finance or operations report.
  2. 2
    Test edge cases
    Months with no data, new categories and filtered-out items.
  3. 3
    Check totals
    Make sure the grand total matches the sum or the intended logic.
  4. 4
    Try every slicer
    Date, region and any role-based filters.
  5. 5
    Document the rule
    Add a description in plain English so others know what it means.

What does this look like in practice?

In a service-reporting suite such as the one we built for Omantel, measures like SLA compliance, closure rate and average response time had to mean the same thing on every page and be compared with last year. AI can draft those measures quickly, but the definitions had to be agreed with service leads first, and every measure was checked against figures the teams already trusted. That is the right split: people define and verify, AI drafts.

“
Everyone reads the same numbers through the same filters, so reviews move straight to decisions.
Omantel case study, UIUX Studio

How should a BI team adopt AI for DAX?

Start with explaining and documenting existing measures, which is low risk and builds trust in the tools. Then use AI for drafting new measures, with a rule that every measure is tested and reviewed by a second person before it reaches a published report. Keep a shared library of approved patterns, such as your standard year-on-year measure, so the AI and the team reuse the same logic. Review the semantic model regularly, because good names and descriptions improve both human understanding and Copilot answers.

It also helps to agree which tools are approved for which tasks. Many teams allow Copilot inside Power BI for anything, and general chatbots only for model structure and anonymised examples. Write that down, so new analysts know the rule from day one.

How UIUX Studio helps

We build Power BI semantic models, measures and reports, and train teams to use AI tools safely. See our Technology Advisory service or read about Power BI report design.

Frequently asked questions

Copilot sees your model directly, which helps; general chatbots can be stronger for long explanations.

Only if your policy allows it. Table and column names are usually enough.

Partly. It is the most common source of errors, so test carefully.

It can suggest variables and simpler patterns; check with Performance Analyzer.

Yes, it is a quick win that also helps Copilot.

U
Written by UIUX Studio Editorial Team
Design & engineering leads, Dubai · India · Australia

For Ambitious Founders

Startup Strategy Session Discuss Your Project with Our Senior Experts

  • No Obligation
  • Expert Insights
  • Tailored Guidance