Reference hub · Tool-belt series · Copilot × Power BI
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.
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.
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
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
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
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
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
git diff the result, you're not reviewing — you're hoping.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
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
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
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
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
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
A handful of reusable shapes cover most of your creative work. Learn them once and mix them per task.
The patterns
Go deeper
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
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
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.
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 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.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
# 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.
.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.