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..
Installs into .claude/skills of the current project.
Are you the author of Powerbi Model?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/santoshkanthety-powerbi-model)
---
name: powerbi-model
description: 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..
license: MIT
---
# 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
```bash
# 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:
```bash
# 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>"`