Power BI DAX

Power BI DAX is a skill for Claude Code, Codex from MinaSaad1/pbi-cli. It costs 126 tokens per session (1,535 once invoked), scanned A, original, MIT.

A workflow for writing and running DAX, the formula and query language used by Power BI to calculate and retrieve data from its models. It can execute queries and return results for inspection or scripts.

In plain words
What is it for?
Use it to create measures, run data queries, calculate totals or time-based results, inspect model data, and validate DAX expressions.
Why use it?
It reduces the need to run DAX manually and helps check calculations against a connected Power BI model. It also supports file, command-line, and scripted query use.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create measures, run data queries, calculate totals or time-based results, inspect model data, and validate DAX expressions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/minasaad1/pbi-cli/power-bi-dax
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add MinaSaad1/pbi-cli --skill power-bi-dax
Clone the repo
git clone --depth 1 https://github.com/MinaSaad1/pbi-cli

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Power BI DAX

README.md
[![agentmods](https://agentmods.dev/badge/skills/minasaad1/pbi-cli/power-bi-dax/github.svg)](https://agentmods.dev/skills/minasaad1/pbi-cli/power-bi-dax)
Your own site
<a href="https://agentmods.dev/skills/minasaad1/pbi-cli/power-bi-dax"><img src="https://agentmods.dev/badge/skills/minasaad1/pbi-cli/power-bi-dax/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Power BI DAX

Your own site · 80×15
<a href="https://agentmods.dev/skills/minasaad1/pbi-cli/power-bi-dax"><img src="https://agentmods.dev/badge/skills/minasaad1/pbi-cli/power-bi-dax.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,535 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00126 $0.01535
Opus 5 $0.00063 $0.00767
Sonnet 5 $0.00025 $0.00307
Haiku 4.5 $0.00013 $0.00153

Measured 10d ago against content hash 496aab8ba12b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

Power BI DAX scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

src/pbi_cli/skills/power-bi-dax/SKILL.md · 211 lines

How it starts

The opening of the file, as written. The whole thing — 211 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Power BI DAX Skill

Execute and validate DAX queries against connected Power BI models.

Prerequisites

pipx install pbi-cli-tool
pbi-cli skills install
pbi connect

Executing Queries

# Inline query
pbi dax execute "EVALUATE TOPN(10, Sales)"

# From file
pbi dax execute --file query.dax

# From stdin (piping)
cat query.dax | pbi dax execute -
echo "EVALUATE Sales" | pbi dax execute -

# With options
pbi dax execute "EVALUATE Sales" --max-rows 100
pbi dax execute "EVALUATE Sales" --timeout 300       # Custom timeout (seconds)

# JSON output for scripting
pbi --json dax execute "EVALUATE Sales"

DAX Expression Limitations in CLI

When passing DAX as a -e argument, the shell collapses newlines into a single line. Simple expressions like SUM(Sales[Amount]) work fine, but multi-line DAX using VAR/RETURN breaks because the DAX parser needs line breaks between those keywords.

Why this matters: A measure like VAR x = [Total Sales] VAR y = [Sales PY] RETURN DIVIDE(x - y, y) will fail with a syntax error because the engine sees it as one continuous line without statement separators.

Workarounds (pick one):

# Option 1: Pipe from stdin (recommended for measures)
echo 'VAR TotalSales = SUM(Sales[Amount])
VAR TotalCost = SUM(Sales[Cost])
RETURN TotalSales - TotalCost' | pbi measure create "Profit" -e - -t Sales

# Option 2: Write to a .dax file and use --file (for queries)
echo 'EVALUATE
ROW("Result",
    VAR x = SUM(Sales[Amount])
    RETURN x
)' > query.dax
pbi dax execute --file query.dax

Single-line alternatives (preferred when possible):

For simple ratio/growth measures, use inline patterns instead of VAR/RETURN:

# Instead of: VAR x = SUM(...) / VAR y = SUM(...) / RETURN DIVIDE(x, y)
# Use inline DIVIDE -- it handles division-by-zero gracefully (returns BLANK):
pbi measure create "Margin %" \
  -e "DIVIDE(SUM(Sales[Amount]) - SUM(Sales[Cost]), SUM(Sales[Amount]))" \
  -t Sales --format-string "0.0%"

# Instead of: VAR current = [Total Sales] / VAR prev = [Sales PY] / RETURN DIVIDE(...)
# Reference measures directly in DIVIDE:
pbi measure create "YoY %" \
  -e "DIVIDE([Total Sales] - [PY Sales], [PY Sales])" \
  -t Sales --format-string "0.0%"

Read the full file on GitHub · 211 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 211 lines · 126 tokens per session scan A 496aab8ba12b

Subscribe to this mod's changes

Power BI DAX is a skill published in the GitHub repository MinaSaad1/pbi-cli (452 stars, last pushed today), licensed MIT. It adds 126 tokens to every session and 1,535 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

powerbi-expert

Expert-level Power BI, DAX, M language, data modeling, Power Query, report design, and paginated reports. Use when the user mentions DAX, Power Query, BI, Microsoft platforms, analytics, or data modeling, or when the task involves DAX Fundamentals, Advanced DAX, Row-Level Security, or Report Design.

personamanagmentlayer/pcl · 73 tokens

powerbi-modeling

Power BI semantic models - DAX measures, star schemas, relationships, RLS, and performance tuning via MCP. Use when creating data models, writing DAX, or configuring table relationships in Power BI.

PracticalSwan/agent-skills · 46 tokens

pbi-check-loop

Closes the verify loop for Power BI Desktop development: reloads a .pbip so Desktop re-reads TMDL/PBIR changed on disk, and captures the window so a model can see what rendered. Power BI has no reload command of its own. Use whenever working on a .pbip project - editing measures, TMDL, relationships, M, visual.json…

C-QY/pbi-check-loop · 276 tokens

mcp-engine-dax-performance

Use when a DAX query, measure, or visual is slow, when interpreting analyze timings, Storage Engine / Formula Engine splits, or query plans, when VertiPaq storage size or cardinality drives cost, or when the user wants a tuning pass or before/after benchmark. For wrong values, use mcp-engine-dax-debugging; for writing…

maxanatsko/mcp-engine-public · 101 tokens

mcp-engine-onboarding

Use when a user types onboarding, asks to set up SemanticOps MCP, wants help choosing Free vs Pro, or wants licensing, modes, masking, guardrails, preferences, model safety, tests, reporting, diagnostics, RLS testing, or Enterprise posture tailored to their workflow. For changing security, policy, or masking on an…

maxanatsko/mcp-engine-public · 86 tokens

mcp-engine-ai-readiness

Use when preparing or assessing a Power BI semantic model for Copilot, Fabric data agents, or natural-language Q&A — clear business terminology, unambiguous metrics, usable date defaults, focused field exposure, descriptions, AI instructions, AI data schema recommendations, verified-answer candidates, or…

maxanatsko/mcp-engine-public · 84 tokens