Semantic model preparation
Prepare the model before asking questions
A semantic model provides named measures, relationships, field descriptions and business definitions. Ambiguous names and conflicting grains produce ambiguous answers. Prep data for AI supports AI data schemas, verified answers and AI instructions on supported models; documentation retrieved labels the feature preview. Descriptions and supported synonym tooling help map business vocabulary to fields. Validate availability and migration from legacy Q&A in the actual build.
Define an explicit metric contract
Use a one-row-per-sale-line table Sales with Region, Month, RevenueCents and CostCents (the fixture uses lowercase JSON keys; map them during import). Define Revenue = sum of revenue cents, Gross Profit = revenue minus cost, Gross Margin = ratio of those totals. Document UTC/month basis, currency, grain, ownership and zero denominator. AI schema selection limits what Copilot considers in relevant skills, not who can read the underlying model. Hiding a field or adding AI instructions is not OLS.
Worked example 1 — precise prompt and DAX
Prompt: "For October 2026, show Gross Margin for North only, using the approved ratio of total gross profit to total revenue. Include revenue and profit in USD, and identify the measure and filter context; do not infer missing values." Illustrative native measures (not executed):
Revenue = DIVIDE(SUM(Sales[RevenueCents]), 100)Gross Profit = [Revenue] - DIVIDE(SUM(Sales[CostCents]), 100)Gross Margin = DIVIDE([Gross Profit], [Revenue])North revenue $150 and profit $50 yield 33.33%. The two row margins are 40% and 20%; averaging them gives 30%, not the requested aggregate. Format Gross Margin as a percentage without converting it to text. Blank is correct when denominator is zero.
Worked example 2 — verified answer design
For the question "October North margin", create a visual using the approved margin and revenue measures. Apply persistent October and North filters; set a verified answer with natural trigger phrases, and check the saved filter definition. Current verified-answer documentation says slicers do not carry into the saved answer. Verify author permissions, supported visual/model and Q&A prerequisite where applicable. Test alternative prompts and mismatched dates; after measure renames, recheck the saved answer. A curated answer still depends on current data and permissions.
Model preparation is not a security boundary
Select relevant fields for the AI schema, use concise descriptions and disambiguate synonyms (sales value versus units). Add model-level instructions describing fiscal dates, currency and ratio-of-sums policy; instructions guide generation, not guaranteed constraints. Do not include secrets in descriptions. Test actual negative permissions after every model change, including direct query paths and export. Record version, test prompts, expected results, actual output and reviewer.
Practice and references
Write the three metric definitions, two synonyms and a verified-answer test plan. Predict the North and South results from fixture.json before running the lab. Consult Prep data for AI, verified answers, AI instructions and AI data schemas.