Sub topic 11
Checking Copilot's work before you publish
Copilot drafts report pages and DAX quickly, but it can be wrong in ways that look right. A page can render cleanly while a measure counts the wrong rows. This chapter gives you a repeatable way to check generated output before anyone else sees it.
This chapter assumes you can read basic DAX, understand filter context, and work with a star-schema model. It builds on the earlier chapters on page creation, DAX measures, and DAX query view.
Why generated output needs checking
Copilot predicts a plausible answer from your prompt and your model's metadata. It does not run your business rules. Three kinds of error are common:
- Wrong field. Copilot picks
Sales[Quantity]when you meantSales[SalesAmount], or a column from the wrong table. - Wrong logic. The DAX is valid but does not match your definition, for example it counts rows instead of distinct orders.
- Wrong context. The measure is correct alone but gives a different result once slicers, relationships, or a missing date table change the filter context.
A visual that has no error message is not evidence of a correct result. Your job is to compare the output against something you already trust.
A validation workflow
Work through these steps in order. Stop at the first step that fails and fix it before moving on.
- Inspect what Copilot built.
- Reconcile totals against a known source.
- Test the measure at several grains and filter combinations.
- Test edge cases.
- Review the model dependencies.
- Record what you checked.
Step 1: Inspect what Copilot built
Check the fields behind each visual
Select a generated visual and open the Visualizations and Data panes. Confirm each field in the field wells. Look for these problems:
- A field from the wrong table, such as a
Customer[City]where you expectedStore[City]. - A column that is summarized implicitly (for example a Sum or Count shown next to the field) when you wanted an explicit measure.
- A visual type that hides the data, such as a pie chart with 40 categories.
- Titles that describe something the visual does not show.
Also check the page-level and visual-level filters. Copilot may add a filter, such as a date range or a top N, that you did not ask for.
Read the DAX before you add it
Never add a suggested measure without reading it. For each expression, ask:
- Which table and column does each reference point to?
- Is the aggregation right:
SUM,AVERAGE,COUNT, orDISTINCTCOUNT? - Does the measure reference existing base measures, or does it repeat their logic?
- Does it use
CALCULATEor filter functions that change the context?
You can ask Copilot to explain the measure. Treat the explanation as a second opinion and not as proof, because the explanation comes from the same model that wrote the code. Compare it against your own reading.
Step 2: Reconcile totals
Reconciliation means checking that a number from Copilot matches the same number from a source you trust. Good reference points include:
- A table visual you build by hand with the same fields.
- A finance report or a source-system query that is already approved.
- A count of rows in the source table, taken from Power Query or the source database.
Start with the grand total, because it removes most filter-context effects. If the grand total is wrong, the problem is in the measure or the model. If the grand total matches but the breakdown does not, the problem is usually a relationship or a filter.
Take this base measure:
Total Sales = SUM ( Sales[SalesAmount] )Suppose your approved finance report shows 4,250,000 for the year. Place Total Sales in a card with a year slicer set to that year. If the card shows 4,250,000, the base measure agrees. Only then build on it.
Check that the parts add up
For a breakdown, the categories should add up to the total. Put the measure in a table by category and compare the total row to the card. A gap of exactly one category's value often means a blank category: sales rows that do not match any row in the dimension table. Check for a blank row in the table and look at relationships if it appears.
Step 3: Test grains and filter combinations
A measure that works at the total level can break at a finer grain. Test the measure with:
- Each slicer used alone, then in combination.
- Each level of a hierarchy, such as year, quarter, and month.
- A single selected value and no selection.
- Rows with no sales in the period.
Some measures are not additive. An average order value should not add up across categories, so the total row should not equal the sum of the rows. Decide beforehand whether the measure is additive, so you know what a correct total looks like.
Step 4: Test edge cases
Edge cases are the inputs that reveal hidden assumptions. Try these:
- Zero denominator. A ratio over an empty selection should return a blank, not an error or infinity.
- Blank dates or keys. Rows with a missing date or a missing relationship key.
- Duplicates. The same order appearing twice in the fact table.
- Partial periods. The current month, which has fewer days than the same month last year.
- Returns and negatives. Rows with a negative
SalesAmount.
Here is the average order value measure from the earlier chapter:
Average Order Value =
DIVIDE ( [Total Sales], DISTINCTCOUNT ( Sales[OrderID] ) )DIVIDE returns a blank when the denominator is zero, so selecting a region with no orders gives a blank and not an error. That is the behavior the prompt asked for. If Copilot had written [Total Sales] / DISTINCTCOUNT ( Sales[OrderID] ), the result for an empty selection would be an error or infinity instead of a blank. Testing an empty selection is how you would catch that.
Also confirm the definition. DISTINCTCOUNT ( Sales[OrderID] ) counts distinct orders. If your business defines an order differently, for example excluding cancelled orders, the measure is valid but wrong for you.
Step 5: Review model dependencies
Some DAX is only correct when the model is set up in a certain way. Check these dependencies whenever Copilot writes time intelligence or cross-table logic.
Sales LY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
Sales YoY % =
DIVIDE ( [Total Sales] - [Sales LY], [Sales LY] )For these measures, verify:
- The
Datetable has a continuous range of dates with no gaps. - It is marked as the model's date table.
- The relationship from
SalestoDateis active and uses the date column. - The visual uses
'Date'[Date]or its hierarchy, not a date column from the fact table.
If a visual uses a date from the fact table, Sales LY can return blanks or the same value as the current period. The DAX is not at fault. The context it relies on is missing.
Also check the first year of data. Sales LY is blank for it, so Sales YoY % is blank too. That is correct, and you should expect it.
| Symptom | Likely cause | What to check |
|---|---|---|
| Total is larger than the source | Duplicate rows or a many-to-many relationship | Row counts and relationship cardinality |
| Total is smaller than the source | A filter Copilot added, or unmatched keys | Page and visual filters, blank dimension row |
| Prior-year measure is blank | Date table is missing or not marked | Date table settings and the date column used |
| Prior-year equals current year | Fact-table date used on the axis | Field on the axis |
| Ratio shows an error | Plain division with a zero denominator | Use of `DIVIDE` |
| Categories do not sum to total | Non-additive measure or blank category | Measure type and dimension rows |
Use DAX query view to compare results
DAX query view lets you test a measure without adding it to the model. This is a safe place to validate a draft. You define the measure locally with DEFINE, then return it next to a measure you already trust.
DEFINE
MEASURE Sales[Average Order Value] =
DIVIDE ( [Total Sales], DISTINCTCOUNT ( Sales[OrderID] ) )
EVALUATE
SUMMARIZECOLUMNS (
'Product'[Category],
"Total Sales", [Total Sales],
"Average Order Value", [Average Order Value]
)
ORDER BY [Total Sales] DESCRun the query and compare the rows with a visual you built by hand. The measure exists only inside the query until you choose to add it to the model. If the numbers disagree, fix the definition in the query and run it again. Add it to the model once the results match.
Step 6: Record what you checked
Keep a short note with each report: what you checked, what source you compared against, the date, and who reviewed it. A note like "Total Sales matches the finance report for FY2026, tested with empty region selection" is enough. It lets the next person repeat the check and helps when a number is questioned later.
For measures that others will reuse, add a description in the model. Describe the business definition, not the formula. The description also helps Copilot interpret the measure in later prompts.
When to ask Copilot to fix its output
If a check fails, you have two options: edit the output yourself, or give Copilot a corrected prompt. Prompt again when the problem is a misunderstanding, and be specific about what was wrong:
The Average Order Value measure counts cancelled orders. Rewrite it to exclude rows where Sales[Status] is "Cancelled".Edit by hand when the fix is small, such as changing one column reference. Prompting again can change parts of the output that were already correct, so re-run your checks after any change.
Exercises
Exercise
Copilot generated Sales YoY % and the visual shows the same value for Sales LY as for Total Sales in every month. The DAX matches the earlier example. Name two things to check first.
Show answer
First, check which date field is on the visual's axis. If it is a date column from the Sales table and not 'Date'[Date], SAMEPERIODLASTYEAR has no proper date context. Second, check that the Date table is marked as the model's date table, has no gaps, and has an active relationship to Sales.
Exercise
A category table shows Total Sales that add up to 4,180,000, but the grand-total card shows 4,250,000. What is a likely cause and how do you confirm it?
Show answer
Some Sales rows probably have no match in the Product table, so they fall into a blank category that is missing or hidden in the visual. Confirm by looking for a blank row in the table, by checking the relationships and key values, and by comparing row counts between the fact table and the matched rows.
Exercise
Why is a Copilot explanation of a measure not enough to validate it?
Show answer
The explanation comes from the same model that wrote the measure, so it can repeat the same misunderstanding. Validation needs an independent comparison, such as a hand-built visual, an approved report, or a source-system query.