power-query
Author, validate, and test Power Query M expressions in semantic model partitions. Automatically invoke when the user mentions "Power Query", "M code", "M expression", "partition expression", "query folding", or asks to "write Power Query", "fix Power Query", "test a partition", "preview partition data", "debug Power Query step", "optimize Power Query".
npx skills add data-goblin/power-bi-agentic-development --skill power-query --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Power Query for Semantic Models Author, validate, and test Power Query M expressions in semantic model import partitions. Covers writing correct M code, preserving query folding, validating expressions, and testing them by executing against real data sources. ## Partition Expressions Each import table in a semantic model has a partition with an M expression defining what data gets loaded during refresh. The expression typically connects to a data source, navigates to a table/view, and applies transformations. ### Structure of a Partition Expression ``` let Source = Sql.Database(#"SqlEndpoint", #"Database"), Data = Source{[Schema="dbo", Item="Orders"]}[Data], #"Removed Columns" = Table.RemoveColumns(Data, {"InternalId"}), #"Changed Type" = Table.TransformColumnTypes(#"Removed Columns", {{"Amount", Currency.Type}}) in #"Changed Type" ``` Key elements: - **Parameters**: `#"SqlEndpoint"`, `#"Database"` are shared M parameters defined at the model level - **Navigation**: `Source{[Schema="dbo", Item="Orders"]}[Data]` navigates to a specific table - **Steps**: Each step is a named variable in the `let...in` chain - **Quoted identifiers**: Step names with spaces use `#"Step Name"` syntax
- Partition Expressions
- Structure of a Partition Expression
- Extracting Expressions
- Writing M Expressions
- Query Folding
- Column Pruning and Row Filtering
- Type Handling
- Naming Conventions
- Validating M Expressions
- 1. Execute via the Power Query API (Recommended)
- 2. Save the Partition via XMLA / TOM
- Choosing a Validation Approach
- Previewing Partition Steps
- Common Patterns
Get partition expression from TMDL via fab
fab get "<Workspace>.Workspace/<Model>.SemanticModel" -f \
Get shared M parameters
shared SqlEndpoint = "myserver.database.windows.net";
shared Database = "MyDB";
shared Result = let
Source = Sql.Database(SqlEndpoint, Database),
Data = Table.FirstN(Source{[Schema="dbo",Item="Orders"]}[Data], 10)
in Data;'
curl -s -o result.bin -X POST ".../executeQuery" \What does the power-query skill do?
Author, validate, and test Power Query M expressions in semantic model partitions. Automatically invoke when the user mentions "Power Query", "M code", "M expression", "partition expression", "query folding", or asks to "write Power Query", "fix Power Query", "test a partition", "preview partition data", "debug Power Query step", "optimize Power Query".
How do I install it?
Run `npx skills add data-goblin/power-bi-agentic-development --skill power-query --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From data-goblin/power-bi-agentic-development, a repository with 833 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
