Sub topic 11
Checking Copilot's Work Before You Publish
This chapter assumes you can build visuals and slicers by hand, read basic DAX, and understand filter context. It also assumes you have a star-schema model with a date table. Copilot output is a draft. You check it before anyone else sees it.
Why checking matters
Copilot can return a page that looks right and a measure that runs without error but answers a different question than the one you asked. Common causes are a wrong field choice, a missing date table, or a vague prompt. Checks take a few minutes and catch most of these problems.
A validation workflow
Step 1: Compare with a known total
Pick a number you trust. It might come from a finance report, a source query, or a card you built by hand. Check that the generated visual's total matches it. Then check one slice, such as a single region or month.
Step 2: Inspect the visuals
For each generated visual, open the Visualizations and Data panes and check:
- Which field is on each axis, and whether it is the one you meant.
- Whether the value is a sum, an average, or a count.
- Whether a visual-level, page-level, or report-level filter hides rows.
- Whether the time range matches the prompt. "Last 12 months" should show twelve months.
Fix anything that is wrong by hand. This is often faster than re-prompting.
Step 3: Read the generated DAX
Ask Copilot to explain the measure, then read the explanation against the code. Take this prompt:
Write a measure that returns the average order value: total sales divided by the number of distinct orders. Handle the case where there are no orders.A good result looks like this:
Average Order Value =
DIVIDE ( [Total Sales], DISTINCTCOUNT ( Sales[OrderID] ) )Check three things. [Total Sales] must exist and be defined as expected. OrderID must be the column that identifies an order. DIVIDE returns a blank instead of an error when the denominator is zero, which covers the edge case in the prompt.
Step 4: Check time intelligence
Time intelligence measures depend on the model, not only on the DAX.
Sales LY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
Sales YoY % =
DIVIDE ( [Total Sales] - [Sales LY], [Sales LY] )These work only if 'Date' is a proper date table, marked as the model's date table, and related to the fact table. If the results are blank or equal to the current year, check the date table and the relationship first.
Step 5: Test in DAX query view
DAX query view lets you test a measure before you add it to the model. The DEFINE block creates it for this query only.
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] DESCCompare the rows with a visual that uses the same fields. If they differ, a filter or relationship is probably affecting one of them. If they match, add the measure to the model.
Common errors to look for
| Symptom | Likely cause |
|---|---|
| Totals differ from the source | Hidden filter, wrong aggregation, or wrong column |
| Year-over-year measure is blank | Date table not marked or not related |
| Average looks too high or low | Counting rows instead of distinct orders |
| A field you did not expect appears | Similar column names or missing descriptions |
| Measure errors on some categories | Division without `DIVIDE` or unhandled blanks |
Exercises
Exercise
Copilot gives you Sales YoY %, and every row shows a blank. The DAX matches the pattern in this chapter. What do you check first?
Show answer
Check the date table. It must be marked as the model's date table, contain continuous dates, and have a relationship to the fact table. SAMEPERIODLASTYEAR depends on it.
Exercise
A generated page shows total sales of 4.2 million, but your finance report shows 3.9 million for the same period. List two things you inspect.
Show answer
Check for filters on the visual, page, or report that change the rows included. Check that the value field is the right column, such as SalesAmount, and uses the right aggregation. Also confirm the time range matches.