Power BI / connected learning guides

Power BI DAX with AI – From Prompt to Formula in Seconds

Use AI to get a first draft, not to decide what revenue means. A DAX query that runs is only the start: prove the result under the intended dates, filters, totals and permissions, then deliberately decide what belongs in the model.

Documentation reviewed 2026-10-30. Learn the concept, inspect the result, validate before release.

1. Find the right surface and check eligibility

In Desktop, the current DAX Copilot article directs you to enable DAX query view with Copilot under Preview features, open a model/report and enter DAX query view. Create a query tab, then use the Copilot button or Ctrl+I. Follow your installed version’s available controls rather than relying on an old GA date.

In the service, start from a semantic model and choose Write DAX queries. This service action requires model Write permission and the appropriate workspace web-model-editing setting. Read-only viewers with the necessary query/Build access can instead use Desktop with a live connection. Do not grant model Write permission merely to let a restricted consumer try a query: that changes the RLS boundary.

Copilot requires paid Fabric F2+ or Premium P1+, supported region/cloud, tenant enablement and the relevant workspace access. Pro/PPU by itself or a Fabric trial is not sufficient. Do not confuse this with the licensing needed simply to write DAX manually.

Official reference: Write DAX queries with Copilot.

2. Give the draft a business definition and an output shape

A better prompt than write sales DAX is: Write a DAX query returning Region[Region] and the existing [Net Revenue] measure for calendar year 2026. Use Date[Date] for the period. Do not create a replacement revenue measure. Explain the filter context and how missing regions are handled.

Supply actual names, grain, calendar, blank/zero behavior and the expected output columns. Ask Copilot to identify assumptions before changing a formula. It can write queries, modify a selection, explain an existing query and explain DAX concepts.

Review the diff, run the draft, then Keep or Discard. Copilot checks generated query syntax and retries once when invalid; this is not a business-rule test. All text in the current query window is included in the request, even when a selection is marked. Remove unrelated sensitive content first.

Official reference: Write DAX queries with Copilot.

3. Prove a tiny known answer before trusting a large visual

For a practice model with three Sales rows of 120, 80 and 45 in Sales[Amount], an unfiltered total should be 245. A query-scoped measure can validate the expression without immediately changing the model:

DEFINE
    MEASURE Sales[Practice Amount] = SUM(Sales[Amount])
EVALUATE
    ROW("Amount", [Practice Amount])

Expected shape: one row, one column named Amount, value 245. Then add a Region dimension with East covering the first two rows and West the last. Verify East 200 and West 45, then test a total and a multi-select. An expression returning 245 in every region is not correct merely because its grand total is right.

DEFINE MEASURE is query-scoped. Keep query keeps the query; use Update model with changes or the individual CodeLens add/overwrite action only when you intend to persist a new or changed measure, have write access and have reviewed the change. These actions can overwrite existing measures. Desktop and a service copy do not automatically synchronize every subsequent edit.

Official reference: DAX query view.

4. Prompt patterns with the checks that make them useful

RequestRequired clarification/test
Year-over-year sales growthActual date table/calendar; missing and zero prior-year behavior; partial periods; numeric percentage format.
Rolling three-month averageAverage of monthly totals or daily values? These are different denominators. Test with unequal month lengths.
Top five customers with tiesRanking by stable customer identity, not a possibly duplicated name; dense-rank versus exactly five rows.
Percent of selected totalWhich slicers/filters remain? Reconcile each row and grand total before choosing ALL or ALLSELECTED.
Refactor for speedPreserve results across the test set, then measure comparable queries with Performance Analyzer or other approved diagnostics.

A daily iterator over a three-month date set does not automatically calculate the average of three monthly totals. A dense-rank condition can include more than five customers. These are definition problems, not issues solved by adding be accurate to a prompt.

Official reference: Write DAX queries with Copilot.

5. Understand the DAX Copilot context limits without overgeneralizing

The DAX Copilot documentation says metadata can be reduced or Copilot unavailable beyond these sizes: 500 tables; 1,000 columns or 3,000 measures in a table; 2,000 relationships; 10,000 total columns; 5,000 total measures; 5,000 characters in a single DAX expression; or 256 characters in a name. These are documented DAX Copilot context considerations, not universal semantic-model size limits.

For this DAX-query feature, Copilot uses metadata and may use min/max sample values in Import mode, not the rest of the table data. It may use only the first 200 characters of descriptions. Do not extend these feature-specific statements to report analysis, which can use data to produce visuals. New DAX functions may be unknown or explained incorrectly; verify them against the function reference.

The AI data schema from Prep data for AI does not narrow DAX-query generation. Keep useful, precise model descriptions, and do not assume hidden fields or a curated AI schema are a security control.

Official reference: Write DAX queries with Copilot.

6. A safe handoff from query to shared model

  1. Keep the original formula and identify the intended behavior change.
  2. Test rows, totals, empty context, zero denominators and intended date periods against independent expectations.
  3. Check real restricted-user behavior; an admin result does not prove RLS.
  4. Compare equivalent workloads before claiming an optimization.
  5. Persist the reviewed model change through the supported action, update its description, and publish/deploy deliberately.
  6. Recheck downstream reports and keep a rollback version.

Review tenant data-handling settings before using AI. Do not claim every Power BI Copilot task sends metadata only or always processes in the same region; context and processing conditions depend on the feature and tenant configuration. Use the official privacy guidance for the intended surface.

For reusable model logic, continue to DAX UDFs or calculation groups. Their correctness still depends on explicit semantics and tests.

Official reference: Power BI Copilot privacy and data use.

Common questions

Does Keep query save every generated measure into the model?

No. Query-scoped definitions stay in the query. Use the supported model-update action deliberately, with write access and validation, to persist model changes.

Can I trust DAX that Copilot says is syntactically valid?

Not without testing. Valid syntax does not prove correct filter context, period logic, totals, blank behavior or business definitions.

Does the AI data schema limit DAX query generation?

No. Microsoft documents that DAX-query generation requires the entire semantic model and does not consider the curated AI data schema.

Does a three-month date iterator always average three monthly totals?

No. A daily iterator can average daily results instead. Specify the intended grain and denominator and test the result against a hand calculation.

Does DAX Copilot send only selected query text?

No. Its documentation says requests include all text in the current query window, with the selected text noted as selected.

Official references and review scope

Checked against the following official vendor documentation on 2026-10-30. This is an independent learning guide, not an official certification or a customer deployment report. These examples have not been executed in your tenant or warehouse. Expected values are teaching acceptance checks; verify current feature availability, licensing, schema, identity and recovery requirements before production use.

Scroll to Top