Home › Power BI / DAX › Power BI and DAX Copilot path instructions

Power BI and DAX Copilot path instructions

Copilot instructions for Power BI projects (PBIP/TMDL): star-schema models, measures over calculated columns, readable DAX with variables, date tables, and safe RLS.

GitHub CopilotPower BI / DAX

How to use

Save this as .github/instructions/powerbi.instructions.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

.github/instructions/powerbi.instructions.mdDownload  
---
applyTo: "**/*.tmdl,**/*.dax,**/*.pbip,**/*.SemanticModel/**,**/*.Report/**"
description: Power BI semantic model and DAX conventions
---

# Power BI and DAX

## Model
- The model is a star schema: fact tables with numeric columns and keys, dimension tables with attributes. Relationships are one-to-many, single direction from dimension to fact. Bi-directional or many-to-many relationships need a comment explaining why.
- One marked date table with continuous dates covers every fact date; relate it on date keys. Disable auto date/time.
- Hide key columns and raw numeric columns that have a measure. Set data types, formats and summarization (`Do not summarize` for IDs and years) on every column.
- Prefer transformations in the source or Power Query over calculated columns; add a calculated column only when it must be sliced or filtered.

## DAX
- Business logic lives in explicit measures stored in a dedicated measures table or display folders. Name measures for what users read ("Sales Amount", "Sales YoY %").
- Use `VAR ... RETURN` for anything used twice or for readability. Use `DIVIDE(n, d)` instead of `/`.
- `CALCULATE` with column predicates (`'Product'[Color] = "Red"`) instead of `FILTER(ALL(Table), ...)` over whole tables. Use `KEEPFILTERS` when a filter should intersect the existing context, `REMOVEFILTERS` to clear it.
- Time intelligence only against the marked date table (`DATESYTD`, `SAMEPERIODLASTYEAR`, `DATEADD`). Inactive relationships via `USERELATIONSHIP` inside the measure.
- Avoid iterating large fact tables with `SUMX`/`FILTER` when a plain aggregation works; avoid `IFERROR`/`ISERROR`.
- Format DAX consistently (one function argument per line for long expressions) and set format strings on measures, not with `FORMAT()`, unless text output is the goal.

## Security and source control
- Row-level security roles filter dimension tables with simple expressions (`[Region] = LOOKUPVALUE(...)` or `USERPRINCIPALNAME()` mapping tables); test each role with "View as".
- Keep projects in PBIP format with TMDL so changes diff cleanly; never commit credentials, cached data or `.pbix` files alongside PBIP sources.

More: all Power BI / DAX rules · all GitHub Copilot rules

Related rules

R tidyverse Copilot path instructions

Path-specific Copilot instructions for R analysis code: tidyverse style, renv, native pipe, reproducible Quarto reports, and testthat.

GitHub CopilotR

Apache Airflow DAGs AGENTS.md

AGENTS.md for Apache Airflow projects: TaskFlow DAGs, fast parse-time code, idempotent tasks, explicit schedules and catchup, connections, small XComs, and DAG tests.

AGENTS.mdApache Airflow

Claude Agent SDK CLAUDE.md

CLAUDE.md for building agents with the Claude Agent SDK (Python/TypeScript): options, tools, permissions, and hooks.

Claude Code (CLAUDE.md)LLM apps & agents

CrewAI multi-agent AGENTS.md

AGENTS.md for CrewAI 1.x projects: YAML agents and tasks, crews and flows, tools, and cost-aware runs.

AGENTS.mdLLM apps & agents

dbt analytics engineering AGENTS.md

AGENTS.md for dbt projects (dbt Core / Fusion 1.9+): staging/marts layering, tests, docs, and selective runs.

AGENTS.mddbt

Google Agent Development Kit (ADK) AGENTS.md

AGENTS.md for Python agents built with Google ADK: agent and tool definitions, sub-agents, session state, adk web/run, and evaluation sets.

AGENTS.mdLLM apps & agents

Get the best new AI prompts every week

One short email a week: the best new prompts and rules for ChatGPT, Claude, Gemini, Midjourney, Cursor and more, plus what changed in the tools. Free, unsubscribe anytime.

Finishes on our newsletter page at beehiiv (opens in a new tab). Or subscribe directly.