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

powerbi-model

Skill3 starsChanged 7 months agoMITView on GitHub

Inspect and modify the connected Power BI Desktop semantic model using powerbi-agent — list tables, measures, relationships, and add new measures. Invoke when the user asks about the data model, wants a measure list, needs to add a measure, or is exploring table structure and relationships. Use when the user mentions: Activate when the user wants to inspect tables / measures / relationships, asks "what's in the model", wants to add a measure, or requests an overview of the data model..

The file

Files
SKILL.md

Skill: Inspect and Modify the Semantic Model

Trigger

Activate when the user wants to inspect tables / measures / relationships, asks "what's in the model", wants to add a measure, or requests an overview of the data model.

Prerequisites

Requires an active connection — run pbi-agent connect first if any command fails with "no connection".

Commands

# Model overview (name, tables, measures, relationships counts)
pbi-agent model info

# List all tables
pbi-agent model tables

# List all measures across the model
pbi-agent model measures

# Filter measures to a single table
pbi-agent model measures --table Sales

# List relationships
pbi-agent model relationships

# Add a new measure (replaces if the name exists)
pbi-agent model add-measure "Total Sales" "SUM(Sales[Amount])" --table Sales

# Add a measure with a format string
pbi-agent model add-measure "YoY Growth" "[Total Sales] / [PY Sales] - 1" \
    --table Sales --format-string "0.0%"

# Pin an SSAS port (skip auto-detect)
pbi-agent model info --port 56123

Guidance

  • add-measure overwrites an existing measure with the same name — confirm with the user before replacing.
  • Table names are case-sensitive; verify with pbi-agent model tables before --table references.
  • For complex DAX with VAR/RETURN, validate via pbi-agent dax validate before calling add-measure.
  • To inspect a single measure's DAX expression, use pbi-agent dax query "EVALUATE FILTER(INFO.MEASURES(), [Name] = \"My Measure\")".

Measure Create Syntax Reference

Two CLIs can add measures; their argument forms are different:

# pbi-agent (this tool) — positional name, then DAX, then --table flag
pbi-agent model add-measure "Total Revenue" "SUM(Sales[Amount])" --table Sales

# pbi-cli (if installed separately) — name positional, -e for expression, -t for table
pbi measure create "Total Revenue" -e "SUM(Sales[Amount])" -t Sales

The three-positional form pbi measure create TableName "Name" "DAX" is wrong for pbi-cli — Click rejects it. Always use -e/-t named flags with pbi measure create.

A measure must exist in the model before any report-layer tool can bind a visual to it — pbi visual bind and pbir both write a reference, not a definition. Create the measure first, then bind. See powerbi-pbi-cli for how the kind (Column vs Measure) and the implicit aggregation are resolved.

Common Failures

  • "No active connection" → run pbi-agent connect
  • Table not found → verify with pbi-agent model tables (exact case)
  • Measure expression invalid → validate first: pbi-agent dax validate "<expr>"

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.