Prompt Engineering · PBIP
0% done A Foundations B Model C Report D Creativity Cheat-sheet

Reference hub · Tool-belt series · Copilot × Power BI

Stop guessing at prompts.
Turn Copilot into a PBIP reviewer that tightens the model and the report.

Power BI Project files are just text — TMDL for the semantic model, JSON for the report. That means GitHub Copilot can read, audit, and edit them like any codebase. This page is the prompting playbook: how to frame a request so Copilot actually helps, the best practices that keep it safe, techniques to unlock ideas — and a copy-paste prompt library at the bottom for the jobs you do again and again.

How to use this page

Same rules as the rest of the tool-belt. Work top to bottom — Parts A–D teach the craft (how Copilot sees a PBIP repo, how to structure a prompt, how to prompt for model efficiency and report quality, and how to get creative), then the Cheat-sheet hands you ready-to-run prompts. Check items off as you go; sections, parts, and the top bar all track progress.

The prompts assume you've opened the PBIP folder in VS Code with GitHub Copilot in agent mode, and that you reference files with #file / #folder or the whole repo with @workspace. Progress saves automatically in this browser on this device; it resets if you clear browser data or open the file elsewhere.

When a request comes in that this page doesn't cover, bring it back to Claude and ask for a new section — it's built to be extended like the rest of your tool belt.

Part A · Foundations & best practices

Prompt Copilot like it can already read your PBIP

Because it can. The whole model and report are text on disk. This part covers how Copilot actually sees a PBIP repo, the five-part anatomy of a prompt that works, how to feed it the right context, and the safety habits that keep a helpful edit from quietly breaking your model.

0 / 0

A .pbix is an opaque binary; a .pbip is a folder of readable text. That single difference is what lets Copilot audit, diff, and edit your work. Before writing a prompt, know what's in the folder and what each file governs.

Learn this

Go deeper

Field noteYour first move in any new PBIP repo: ask Copilot to map it. “List every file under the two definition folders and tell me, in one line each, what it governs.” Now you both share a mental model before you touch anything.

Most weak prompts are missing one of five ingredients. Name the role, point at the context, state the task, set the constraints, and specify the output format — and vague answers turn into precise, checkable ones.

Learn this

See it assembled

# role      Act as a Power BI performance reviewer.
# context   Read #folder:Sales.SemanticModel/definition/tables. The Sales
#           fact is daily grain; Date is a proper dimension.
# task      Find columns that inflate model size.
# constraintReport only — do NOT edit any files.
# format    A markdown table: column | issue | size impact | fix.

Go deeper

Field noteIf an answer disappoints, don't just re-ask — diagnose which of the five was missing. Nine times out of ten it's constraints or format.

Copilot is only as good as what's in its window. The skill is choosing the minimum context that fully specifies the job — too little and it guesses, too much and it drifts.

Learn this

Go deeper

Field notePasting a VertiPaq Analyzer table into the prompt is the single highest-leverage move on this page. Copilot stops speculating about size and starts reasoning about your numbers.

The best results come from a conversation, not a one-shot. Get a plan before edits, keep changes small enough to review, and steer with specific corrections instead of starting over.

Learn this

Go deeper

Field note“Don't change anything yet” is the most useful five words in your vocabulary. It converts an edit tool into a review tool for exactly as long as you want.

Copilot editing TMDL and JSON directly is powerful and occasionally wrong. A few habits make every change safe to accept — or safe to throw away.

Learn this

Go deeper

Field noteTreat “git is clean” as the precondition for every editing prompt. If you can't git diff the result, you're not reviewing — you're hoping.

Part B · Prompting for model efficiency

Make the semantic model smaller and faster

The model is where performance is won or lost. These are the prompts that turn Copilot into a size auditor and a DAX optimizer — grounded in the same techniques as the VertiPaq / Best Practice Analyzer world, now applied straight to your TMDL.

0 / 0

Most bloated models share the same handful of causes. Teach Copilot to hunt for them by name and it becomes a fast, repeatable size review over your TMDL.

Prompt it to find

Go deeper

Field noteAsk for the audit as a ranked table with an estimated size impact. Ranking forces prioritisation — you fix the two columns that matter instead of the twenty that don't.

Copilot is strong at DAX refactoring when you pin the rules. Give it the patterns to prefer and the invariant to protect, and ask it to explain the win so you learn as it edits.

Prompt it to prefer

Go deeper

Field noteHave Copilot rewrite, then paste both versions into DAX Studio Server Timings to confirm the speed-up is real. Trust the trace, not the claim.

Beyond column-level cleanup, the shape of the model decides how fast and maintainable it is. These prompts ask Copilot to reason about structure, not just syntax.

Prompt it to assess

Go deeper

Field noteDesign changes are the ones to plan first, edit later. Ask for the reshape as a proposal with trade-offs, decide, then let Copilot apply it one table at a time.

Part C · Prompting for report enhancements

Polish the report the model feeds

The report is JSON too — so Copilot can audit layout, enforce a theme, and catch accessibility gaps across every page at once. These prompts turn “make it look better” into specific, page-by-page fixes.

0 / 0

Consistency is what separates a polished report from a busy one — and it's exactly the kind of mechanical check Copilot does well across many pages.

Prompt it to check

Go deeper

Field noteTheme edits are low-risk and high-visibility — a great first “let Copilot actually edit” task once you've done a couple of report audits.

Accessibility gaps are easy to miss by eye and easy to catch in JSON. Copilot can sweep every page for the ones that matter most.

Prompt it to flag

Go deeper

Field noteFrame it as “give me the page, the visual id, and the specific fix.” A finding you can't locate is a finding you won't act on.

A faster, richer report is often about doing more with fewer visuals. Ask Copilot to suggest interactivity that replaces clutter — and to name what's slowing a page down.

Prompt it to suggest

Go deeper

Field notePair this with Performance Analyzer: export the slowest page, paste it in, and ask Copilot which visuals to consolidate. Evidence in, targeted suggestions out.

Part D · Unlocking creativity

Prompt patterns and your own prompt library

The techniques that get you past “make it better” into ideas you wouldn't have reached alone — personas, self-critique, reverse-prompting — plus how to save your best prompts so the whole team (or future you) reuses them.

0 / 0

A handful of reusable shapes cover most of your creative work. Learn them once and mix them per task.

The patterns

Go deeper

Field noteGenerate-then-critique is the sleeper. “Now poke holes in what you just proposed” routinely catches an over-engineered change before you accept it.

When you're stuck, the move is to change who's asking the questions. These flip the usual direction and shake loose options you wouldn't prompt for directly.

Try these

Field noteKeep a running note of prompts that surprised you in a good way. That note is the seed of your prompt library (D3) — and half of it graduates into the cheat-sheet below.

A great prompt you have to retype is a great prompt you'll stop using. Bake the recurring ones into the repo so Copilot applies them by default.

Learn this

Go deeper

Field noteCustom instructions are the compounding investment on this page. Write them once and every future prompt starts smarter — grab the starter from the cheat-sheet and adapt it to your repo.

Cheat-sheet · Copy, paste, run

The prompt library

Ready-to-run prompts for the jobs you repeat. Open the PBIP folder in VS Code with Copilot in agent mode, adjust the highlighted placeholders, and paste. Nothing here edits your files until you say so — every audit prompt reports first.

Map the repofirst thing in a new PBIP project
You are onboarding me to this Power BI Project. Read @workspace.
List every file under the .SemanticModel/definition and
.Report/definition folders and tell me, in one line each, what it
governs. Then summarise: what does this model represent, what is the
grain of each fact table, and which tables are dimensions? Ask me a
question if any table's grain is ambiguous. Don't change anything.
Full model auditreport only — no edits
Act as a Power BI performance reviewer. Read every .tmdl file under
#folder:YourModel.SemanticModel/definition/tables. Produce a
prioritised markdown table: Object (file, table, column/measure) |
Issue | Why it costs size or speed | Suggested TMDL fix. Check for:
high-cardinality columns, oversized data types, DateTime columns that
should be split or reduced to Date, columns with summarizeBy that
should be None, hidden or unused columns, columns not referenced by
any measure or relationship, and bidirectional relationships. Rank by
impact. Do NOT edit any files yet — report only.
Explain one measurelearn what it does + risks
Explain the measure [Measure Name] in #file:Sales.tmdl in
plain English: what it calculates, step by step. Then list any
correctness or performance risks — context transition, FILTER over a
whole table, repeated CALCULATE, missing DIVIDE. Don't rewrite it yet;
just tell me what to watch.
Plan the shrinkapprove before it edits
Here are my VertiPaq Analyzer metrics:
[paste the table]
Based on these and the TMDL in #folder:YourModel.SemanticModel/definition,
propose the top 10 changes that would most reduce model size, ranked
by expected impact. For each: the exact TMDL edit, the table/column,
and the trade-off — does it break any measure, relationship, or
report visual? Wait for my go-ahead, then apply them one table at a
time, pausing after each so I can review the diff.
Optimise DAXkeep the number identical
Optimise the measure [Measure Name] for a large fact table.
Prefer variables over repeated expressions, DIVIDE over the /
operator, TREATAS or KEEPFILTERS over FILTER across an entire table,
and avoid unnecessary context transition. Keep the result numerically
identical. Output the new DAX, then a short bullet list of exactly
what changed and why each change is faster.
Data-type & cardinality passreport first
Scan every column in #folder:YourModel.SemanticModel/definition/tables.
Flag columns whose data type is larger than needed (Decimal that
could be Int64; DateTime that should be Date or split into Date +
Time) and any high-cardinality text key that should be an integer
surrogate. Give me the TMDL edit for each, as a table of file |
column | current | suggested | why. Report only — don't apply.
Report consistency auditpage-by-page
Read the report under #folder:YourReport.Report/definition. For
each page list: visual count, fonts/colours that don't match the
theme, misaligned or overlapping visuals, and visuals missing a title
or alt text. Output a markdown checklist grouped by page, with the
visual id for each item. Don't edit anything yet.
Accessibility passlocate every fix
Review the report JSON in #folder:YourReport.Report/definition for
accessibility. Flag: visuals with no alt text, colour used as the
only encoding, low-contrast custom colours, and tab order that
doesn't follow reading order. For each finding give me the page, the
visual id, and the specific fix. Report only.
Apply the themelist changes before applying
Here is my theme file #file:theme.json. Find every visual in
#folder:YourReport.Report/definition that overrides theme colours
or fonts with hard-coded values, and rewrite them to inherit from the
theme instead. First list each change as page | visual | what changes.
Wait for my OK, then apply and show me the diff.
Give me three approachessimple / polished / ambitious
I want to [goal, e.g. show YoY growth by region on one page].
Propose 3 distinctly different ways to design this in Power BI: a
simple one, a polished one, and an ambitious one. For each: the
visuals, the DAX or field parameters needed, and the trade-offs. Then
recommend one and say why.
Reverse the promptsurface the real requirements
I'm about to redesign this report page for [audience]. Before
you suggest anything, ask me the 5 questions you most need answered to
do this well. Then wait for my answers.
Critique your own workcatch over-engineering
You just proposed those changes. Now switch roles: act as a skeptical
senior Power BI architect and try to poke holes in them. What could
break, what did you miss, what's over-engineered? Then give me your
revised recommendation.
What am I missingfind your blind spots
Read @workspace. Assume I'm a competent analyst with blind spots.
List 8 improvements I probably haven't thought of — across
performance, modelling, report UX, and maintainability — ranked by
effort-to-impact. One line each, with where to start.
.github/copilot-instructions.mdcommit it so every prompt starts smarter
# Copilot instructions — Power BI PBIP project

This repository is a Power BI Project (PBIP).
- The semantic model lives in *.SemanticModel/definition/ as TMDL.
- The report lives in *.Report/definition/ as PBIR JSON.
- Themes live under *.Report/StaticResources/.

When editing:
- Preserve valid TMDL and JSON — never break the schema.
- Keep DAX results numerically identical unless I ask otherwise.
- Prefer star-schema modelling, integer keys, and the smallest
  correct data type.
- Prefer variables, DIVIDE, and KEEPFILTERS/TREATAS over FILTER over
  whole tables.
- Explain the trade-off of any change, and show a diff before applying.
- When unsure about a table's grain or a measure's intent, ask before
  editing.

When reviewing:
- Report findings as a ranked table I can act on (file, issue, fix).
- Don't edit files during an audit unless I explicitly say to.
How to useSave this as .github/copilot-instructions.md at the repo root, tweak the rules to match your standards, and commit it. Copilot applies it automatically to every request in the workspace.