Live survey315 models · 14 providers · 23,592 auditsAudited implement · SAFE →What changedHow we verifyllms.txt

Agent skill · Audited from source

Power Query

skill · data-goblin/power-bi-agentic-developmentGPL-3.0 licenceAudited 13 Oct 2026 · source b8d9b0f3c97a

★ 1,039pushed today
✓SAFEGrade B · 89/100 · 13 Oct 2026 · b8d9b0f
1,039repo stars · whole data-goblin/power-bi-agentic-development

Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit b8d9b0f3c97a and found no filesystem, network or shell access and no hard-coded secrets. What it does: 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…

Ask an AI about this pageGChatGPTCClaudePPerplexityGeGeminiXGrok
More
Cite

Cite this page

ModelsAtlas. “Power Query (data-goblin/power-bi-agentic-development)”. Retrieved 13 Oct 2026. https://modelsatlas.com/skills/data-goblin/power-query

Trust audit

Audit 0.4.1 · source read 13 Oct 2026

Trust score89/100✓SAFE B
0 critical0 high0 medium0 low0 info

SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.

What the source does

  • FilesystemNone observedNo reads or writes in the source
  • NetworkNone observedNo outbound calls in the source
  • ShellNone observedNo commands run in the source
  • DependenciesPinnedNothing floats
  • SecretsNone foundNo keys in source

Five audit layers

LayerWhat we checkResultFindings
L0 ProvenanceRepo owner, licence, archive status, activityPASS0
L1 Static sourceSecrets, path traversal, supply chain, hidden codePASS0
L2 InstructionsPrompt injection, authority framing, hidden directivesPASS0
L3 InventoryThe files and declarations match the sourcePASS0
L4 SandboxRun in isolation and watch behaviourSKIPPED why0

Gates applied: no behavioural pass.

Findings (0)

No findings at any severity. We re-audit when the source changes.

Audit 0.4.1 · source sha b8d9b0f3c97a · 13 Oct 2026Report an issue or request a re-scan

Provenance

Who published it, and what the verdict is pinned to

  • Publisherdata-goblin GitHub userOwner of the repository this skill is read from
  • Source folderdata-goblin/power-bi-agentic-development/plugins/semantic-models/skills/power-queryThe exact folder we audited
  • LicenceGPL-3.0As the repository states it
  • Commit pinned for this verdictb8d9b0f3c97aA new audit runs when the source changes
  • Repository statusNot archivedPushed today
  • Sandboxed runNot runSkills are read, not executed; layer L4 is skipped

What it tells the agent

Full source on GitHub ↗

Its description: 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…

---
name: power-query
description: 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".
---

# 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

### Extracting Expressions

```bash
# Get partition expression from TMDL via fab
fab get "<Workspace>.Workspace/<Model>.SemanticModel" -f \
  -q "definition.parts[?path=='definition/tables/<Table>.tmdl'].payload"

# Get shared M parameters
fab get "<Workspace>.Workspace/<Model>.SemanticModel" -f \
  -q "definition.parts[?path=='definition/expressions.tmdl'].payload"
```

## Writing M Expressions

### Query Folding

Query folding is the most important performance concept. The M engine translates compatible steps into native data source queries (e.g., SQL). When folding breaks, subsequent steps run in the mashup engine, pulling all data into memory first.

**Steps that typically fold** (for SQL sources):
- `Table.SelectColumns` / `Table.RemoveColumns` -> `SELECT`
- `Table.SelectRows` -> `WHERE`
- `Table.Sort` -> `ORDER BY`
- `Table.FirstN` -> `TOP`
- `Table.Group` -> `GROUP BY`
- `Table.RenameColumns` -> `AS` aliases

**Steps that may or may not fold** (source-dependent):
- `Table.TransformColumnTypes` -- frequently breaks folding for text-to-numeric/date conversions on SQL Server sources. Use `Table.TransformColumns` with explicit conversion functions (e.g., `Number.From`) as a more reliable foldable alternative.

**Steps that break folding:**
- `Table.AddColumn` with custom M functions (not translatable to SQL)
- `Table.Buffer` (forces materialization; prefer `Table.StopFolding` to stop folding without the memory overhead)
- `Table.LastN` (no SQL equivalent without subquery)
- `Table.Combine` across different data sources (cross-database folding within the same SQL Server is possible via `EnableCrossDatabaseFolding`)
- Complex `each` expressions with M-specific logic
- Any step after a fold-breaking step

**Best practice:** Apply folding-compatible steps (filter, select, type) early; add custom columns and M-only transforms after all foldable work is done.

### Column Pruning and Row Filtering

Remove unused columns and filter rows as early as possible:

```
let
    Source = Sql.Database(SqlEndpoint, Database),
    Data = Source{[Schema="dbo", Item="Orders"]}[Data],
    // Filter and select BEFORE any custom transforms
    #"Filtered" = Table.SelectRows(Data, each [Status] <> "Cancelled"),
    #"Selected" = Table.SelectColumns(#"Filtered", {"OrderId", "Date", "Amount", "CustomerId"})
in
    #"Selected"
```

These steps fold to SQL: `SELECT OrderId, Date, Amount, CustomerId FROM dbo.Orders WHERE Status <> 'Cancelled'`

### Type Handling

- Apply `Table.TransformColumnTypes` early (folds to `CAST` in SQL)
- Use explicit M types: `Int64.Type`, `type text`, `type date`, `Currency.Type`, `type logical`
- Avoid implicit type inference on large datasets

### Naming Conventions

- Step names should describe the transformation: `#"Removed Duplicates"`, `#"Filtered Active"`
- Avoid generic names like `#"Custom1"` or `#"Step1"`
- Use quoted identifiers `#"Name"` for steps with spaces (Power Query convention)

## Validating M Expressions

Two approaches to validate that an M expression is syntactically correct and produces expected results:

### 1. Execute via the Power Query API (Recommended)

Test the expression by running it against real data. This validates syntax, data source connectivity, and transformation correctness in one step.

The full workflow, run by the bundled `examples/execute_m.py`:

1. Create or reuse a runner dataflow in the workspace
2. Bind the data source connection to the runner
3. Wrap the expression in a section document, inline parameters
4. Execute via `POST /v1/workspaces/{wsId}/dataflows/{dfId}/executeQuery`
5. Parse the Arrow response to verify data

```bash
MASHUP='section Section1;
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" \
  -H "Authorization: Bearer ${TOKEN}" -H "Content-Type: application/json" \
  -d "$(jq -n --arg m "$MASHUP" '{queryName:"Result",customMashupDocument:$m}')"
```

See **`references/validation.md`** for step-by-step instructions and error handling.

### 2. Save the Partition via XMLA / TOM

Write the expression back to the model; Analysis Services validates the M syntax on save. This doesn't execute the query but catches

Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.

Install

Pinned to the audited commit b8d9b0f

Download folder ↗
uv run --with pyarrow python3 -c "

Commands as the repository documents them: shown, never run by us. Our verdict covers commit b8d9b0f3c97a only.

Works in

The author has not said which agents this skill supports, and we have not tested it in any.

Audit history

Every audit, every source change

  1. ✓SAFE B 89 / 100

    first audit · source b8d9b0f3c97a

README badge

For maintainers · shows the latest audit

ModelsAtlas: SAFE BMODELSATLASSAFE · B
[![ModelsAtlas: SAFE B](https://modelsatlas.com/skills/data-goblin/power-query/badge.svg)](https://modelsatlas.com/skills/data-goblin/power-query/)

The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.

Audit Tenant Settings!CAUTION

data-goblin/power-bi-agentic-development

Automatically invoke this skill whenever the user asks about Fabric tenant settings or Power BI tenant settings or auditing tenant settings. You can use this skill if the user mentions "Fabric administration".

★ 1kGrade B
Bpa Rules✓SAFE

data-goblin/power-bi-agentic-development

Interactive BPA rule generation for Power BI semantic models; guided discovery, model investigation, and expert rule authoring. Automatically invoke when the user mentions "BPA rule", "Best Practice Analyzer", or asks…

★ 1kGrade B
C Sharp Scripting✓SAFE

data-goblin/power-bi-agentic-development

Writing and executing C# scripts and macros against Power BI semantic models using Tabular Editor 2/3. Automatically invoke when the user mentions "C# script", "Tabular Editor script", "TOM scripting",…

★ 1kGrade B
Connect Pbid✓SAFE

data-goblin/power-bi-agentic-development

TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field…

★ 1kGrade B
Create Pbi Report✓SAFE

data-goblin/power-bi-agentic-development

Step-by-step workflow for creating complete Power BI reports from scratch using pbir CLI. Covers model discovery, report creation, page layout, theme setup, visual placement, field binding, filtering, formatting,…

★ 1kGrade B
Dax✓SAFE

data-goblin/power-bi-agentic-development

DAX performance optimization for semantic models. Automatically invoke when the user asks to "optimize DAX", "fix slow DAX", "DAX performance", "tune a measure", "debug a measure", "DAX anti-patterns", or mentions slow…

★ 1kGrade B

Add this badge to your README

[![ModelsAtlas: SAFE B](https://modelsatlas.com/skills/data-goblin/power-query/badge.svg)](https://modelsatlas.com/skills/data-goblin/power-query/)

Questions about Power Query

What does the Power Query skill do?
Power BI AI skills and Power BI agents for Claude Code and GitHub Copilot: a plugin marketplace of Power BI skills, subagents, and hooks for semantic models, DAX, TMDL, reports, and AI dashboards. Includes Microsoft Fabric skills and Fabric agents. Weekly updates.
Is Power Query safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Power Query access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (b8d9b0f3c97a), read on 2026-10-13. The repository is watched, and a new audit runs when it changes — this is the first audit.

Sources

Spotted something wrong? Report a correction · Methodology

Keep going in your AI

Opens with this page as the source. We add nothing else to the prompt.