power-query

Author, validate, and test Power Query M expressions in semantic model partitions.

887|131|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/data-goblin/power-bi-agentic-development --skill power-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: power-query
Source: https://github.com/data-goblin/power-bi-agentic-development/tree/main/plugins/semantic-models/skills/power-query
Command: npx skills add https://github.com/data-goblin/power-bi-agentic-development --skill power-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyarrow, and includes references (resource) and scripts (resource) components.

What problem does it solve?

Writing Power Query M expressions for semantic model partitions is error-prone: syntax mistakes, broken query folding, and wrong column references often surface only at refresh time. This Skill provides structured guidance and executable tooling to write, validate, and debug M expressions against real data sources before deployment.

Core Features & Use Cases

  • M Expression Authoring: Guidance on partition expression structure, query folding preservation, column pruning, row filtering, and type handling for import partitions.
  • Validation via Fabric API: Execute M expressions against real data sources using the executeQuery API with a runner dataflow, or perform quick syntax checks by saving partitions via XMLA/TOM.
  • Step-by-Step Debugging: Preview data at any step in the let...in chain by truncating the expression, with row limits via Table.FirstN for large tables.
  • Use Case: A modeler needs to add a filtered partition to an Orders table. The Skill helps write a folding-compatible M expression, executes it against the SQL source to verify columns and types, then previews intermediate steps to confirm the filter logic before deploying via TMDL.

Quick Start

Ask the agent to write and test a Power Query partition expression for a table in your semantic model, for example: write and validate an M expression that loads active orders from the dbo.Orders table.

Frequently Asked Questions about power-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a Power Query M expression before deploying it?

Execute the expression via the Fabric executeQuery API by wrapping it in a section document with inlined shared parameters and posting it to a runner dataflow. The response returns actual data as an Arrow stream, confirming syntax, connectivity, and transformation correctness.

What is query folding in Power Query and why does it matter?

Query folding translates M steps into native SQL so the data source does the work instead of the mashup engine. When folding breaks, all data is pulled into memory and processed locally, which causes slow refreshes and timeouts on large tables.

Which Power Query steps break query folding on SQL sources?

Common fold-breakers include Table.Buffer, Table.AddIndexColumn, Table.LastN, Table.Transpose, Text.Proper, Table.SplitColumn, and custom lambda functions in row context. Once folding breaks, all subsequent steps also run locally in the mashup engine.

How do I preview data at a specific step in a Power Query expression?

Change the in clause of the let...in expression to reference the step name you want to inspect, then execute it via the API. Adding Table.FirstN around the final step limits rows for large tables during debugging.

Why does my Power Query execution fail with a credentials error?

The error 'Credentials are required to connect to the SQL source' means the data source connection is not bound to the runner dataflow. Bind the connection via the updateDefinition API call before executing the query.

Can I validate M syntax without executing the query against data?

Yes, save the partition expression to the model via XMLA/TOM or deploy the edited TMDL file. Analysis Services validates the M syntax on save, catching structural errors like mismatched let/in blocks, though it misses runtime issues like wrong column names.