agentleFS
santoshkanthetysantoshkanthety/powerbi-agent/skills/powerbi-dax/SKILL.md

powerbi-dax

Skill3 starsChanged 7 months agoMITView on GitHub

Execute and validate DAX queries and expressions against a connected Power BI Desktop model via powerbi-agent. Invoke when the user mentions DAX, asks to run a query, test a formula, use EVALUATE / CALCULATE / SUMMARIZECOLUMNS, or validate an expression before saving as a measure. Use when the user mentions: Activate when the user wants to run a DAX query, test a DAX expression, validate syntax, explore model data via DAX, or aggregate values from the connected Power BI Desktop model..

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Must have an active connection — run pbi-agent connect first if DAX commands fail with "no connection".

    line 13
  2. Very specific:

    Prefer inline single-expression form: DIVIDE([A] - [B], [B]) instead of VAR x = [A] VAR y = [B] RETURN ...

    line 37
  3. Very specific:

    If VAR/RETURN is required, test the single-line collapsed form first (VAR x = ...

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Run and Validate DAX

Trigger

Activate when the user wants to run a DAX query, test a DAX expression, validate syntax, explore model data via DAX, or aggregate values from the connected Power BI Desktop model.

Prerequisites

Must have an active connection — run pbi-agent connect first if DAX commands fail with "no connection".

Commands

# Run a DAX query (default table output)
pbi-agent dax query "EVALUATE TOPN(10, Sales)"

# Pick output format
pbi-agent dax query "EVALUATE VALUES('Product'[Category])" --format json
pbi-agent dax query "EVALUATE Sales" --format csv

# Constrain to a specific table context
pbi-agent dax query "CALCULATE(SUM(Sales[Amount]))" --table Sales

# Pin the SSAS port (skip auto-detect)
pbi-agent dax query "EVALUATE INFO.TABLES()" --port 56123

# Validate an expression without executing
pbi-agent dax validate "CALCULATE(SUM(Sales[Amount]), YEAR(Sales[Date])=2024)"

Shell Quoting Notes

Multi-line DAX (VAR / RETURN) passed as a shell argument loses line breaks and breaks parsing. For multi-line expressions:

  • Prefer inline single-expression form: DIVIDE([A] - [B], [B]) instead of VAR x = [A] VAR y = [B] RETURN ...
  • If VAR/RETURN is required, test the single-line collapsed form first (VAR x = ... RETURN ... on one line — DAX accepts whitespace separators)

Common Exploration Patterns

# Inventory the model
pbi-agent dax query "EVALUATE INFO.TABLES()"
pbi-agent dax query "EVALUATE INFO.MEASURES()"
pbi-agent dax query "EVALUATE INFO.RELATIONSHIPS()"

# Preview a table
pbi-agent dax query "EVALUATE TOPN(10, Sales)"

# Row count
pbi-agent dax query "EVALUATE ROW(\"Count\", COUNTROWS(Sales))"

# Group-by aggregation
pbi-agent dax query "EVALUATE SUMMARIZECOLUMNS(Products[Category], \"Total\", SUM(Sales[Amount]))"

Common Failures

  • "No active connection" → run pbi-agent connect
  • Syntax error on VAR/RETURN → collapse to single-line DIVIDE / inline form, or test with pbi-agent dax validate first
  • Table not found → run pbi-agent model tables to verify the exact name (case-sensitive)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.