/power-bi-modeling
Create and manage Power BI semantic model structure using pbi-cli -- tables, columns, measures, relationships, hierarchies, calculation groups, and date/calendar tables. Invoke this skill whenever the user says "create table", "add measure", "add column", "create relationship",
$ npx -y skills add MinaSaad1/pbi-cli --skill power-bi-modeling --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/power-bi-modeling
Context preview
The summary Claude sees to decide when to auto-load this skill.
Create and manage Power BI semantic model structure using pbi-cli -- tables, columns, measures, relationships, hierarchies, calculation groups, and date/calendar tables. Invoke this skill whenever the user says "create table", "add measure", "add column", "create relationship",
SKILL.md
power-bi-modeling.SKILL.mdname: Power BI Modeling
description: Create and manage Power BI semantic model structure using pbi-cli -- tables, columns, measures, relationships, hierarchies, calculation groups, and date/calendar tables. Invoke this skill whenever the user says "create table", "add measure", "add column", "create relationship", "date table", "calendar table", "star schema", "mark as date table", "add hierarchy", "calculation group", or any model-building task. Also invoke when creating multiple measures at once -- the skill contains critical guidance on multi-line DAX expression handling.
tools: pbi-cli
Power BI Modeling Skill
Use pbi-cli to manage semantic model structure. Requires `pipx install pbi-cli-tool`, `pbi-cli skills install`, and `pbi connect`.
Prerequisites
pipx install pbi-cli-tool
pbi-cli skills install
pbi connect
Tables
pbi table list # List all tables
pbi table get Sales # Get table details
pbi table create Sales --mode Import # Create table
pbi table delete OldTable # Delete table
pbi table rename OldName NewName # Rename table
pbi table refresh Sales --type Full # Refresh table data
pbi table schema Sales # Get table schema
pbi table mark-date Calendar --date-column Date # Mark as date table
Columns
pbi column list --table Sales # List columns
pbi column get Amount --table Sales # Get column details
pbi column create Revenue --table Sales --data-type double --source-column Revenue # Data column
pbi column create Profit --table Sales --expression "[Revenue]-[Cost]" # Calculated
pbi column delete OldCol --table Sales # Delete column
pbi column rename OldName NewName --table Sales # Rename column
Measures
pbi measure list # List all measures
pbi measure list --table Sales # Filter by table
pbi measure get "Total Revenue" --table Sales # Get details
pbi measure create "Total Revenue" -e "SUM(Sales[Revenue])" -t Sales # Basic
pbi measure create "Revenue $" -e "SUM(Sales[Revenue])" -t Sales --format-string "\$#,##0" # Formatted
pbi measure create "KPI" -e "..." -t Sales --folder "Key Measures" --description "Main KPI" # With metadata
pbi measure update "Total Revenue" -t Sales -e "SUMX(Sales, Sales[Qty]*Sales[Price])" # Update expression
pbi measure delete "Old Measure" -t Sales # Delete
pbi measure rename "Old" "New" -t Sales # Rename
pbi measure move "Revenue" -t Sales --to-table Finance # Move to another table
**Multi-line DAX in measure expressions:** The `-e` flag passes DAX as a shell argument, which collapses newlines. For simple expressions like `SUM(Sales[Amount])` or `DIVIDE([A] - [B], [B])` this works fine. For complex expressions using VAR/RETURN, pipe from stdin instead:
echo 'VAR TotalSales = SUM(Sales[Amount])
VAR TotalCost = SUM(Sales[Cost])
RETURN TotalSales - TotalCost' | pbi measure create "Profit" -e - -t Sales
See the **power-bi-dax** skill for the full explanation and more workarounds.
Relationships
pbi relationship list # List all relationships
pbi relationship get RelName # Get details
pbi relationship create \
--from-table Sales --from-column ProductKey \
--to-table Products --to-column ProductKey # Create relationship
pbi relationship delete RelName # Delete
pbi relationship find --table Sales # Find relationships for a table
pbi relationship activate RelName # Activate
pbi relationship deactivate RelName # Deactivate
Hierarchies
pbi hierarchy list --table Date # List hierarchies
pbi hierarchy get "Calendar" --table Date # Get details
pbi hierarchy create "Calendar" --table Date # Create
pbi hierarchy delete "Calendar" --table Date # Delete
Calculation Groups
pbi calc-group list # List calculation groups
pbi calc-group create "Time Intelligence" --description "Time calcs" # Create group
pbi calc-group items "Time Intelligence" # List items
pbi calc-group create-item "YTD" \
--group "Time Intelligence" \
--expression "CALCULATE(SELECTEDMEASURE(), DATESYTD(Calendar[Date]))" # Add item
pbi calc-group delete "Time Intelligence" # Delete group
Creating a Date/Calendar Table
Date tables are essential for time intelligence functions (TOTALYTD, SAMEPERIODLASTYEAR, DATEADD, etc.).
# Create a calculated date table with DAX (covers full calendar years)
pbi table create Calendar \
--dax-expression "ADDCOLUMNS(CALENDAR(DATE(2023,1,1), DATE(2024,12,31)), \"Year\", YEAR([Date]), \"MonthNumber\", MONTH([Date]), \"MonthName\", FORMAT([Date], \"MMMM\"), \"Quarter\", \"Q\" & FORMAT([Date], \"Q\"))"
# Mark it as a date table (required for time intelligence)
pbi table mark-date Calendar --date-column Date
# Verify it's recognized as a date table
pbi calendar list
Workflow: Create a Star Schema
# 1. Create fact table
pbi table create Sales --mode Import
# 2. Create dimension tables
pbi table create Products --mode Import
pbi table create Calendar --mode Import
# 3. Create relationships
pbi relationship create --from-table Sales --from-column ProductKey --to-table Products --to-column ProductKey
pbi relationship create --from-table Sales --from-column DateKey --to-table Calendar --to-column DateKey
# 4. Mark date table
pbi table mark-date Calendar --date-column Date
# 5. Add measures
pbi measu
Read more
name: Power BI Modeling description: Create and manage Power BI semantic model structure using pbi-cli -- tables, columns, measures, relationships, hierarchies, calculation groups, and date/calendar tables. Invoke this skill whenever the user says "create table", "add measure", "add column", "create relationship", "date table", "calendar table", "star schema", "mark as date table", "add hierarchy", "calculation group", or any model-building task. Also invoke when creating multiple measures at once -- the skill contains critical guidance on multi-line DAX expression handling. tools: pbi-cli
Power BI Modeling Skill
Use pbi-cli to manage semantic model structure. Requires `pipx install pbi-cli-tool`, `pbi-cli skills install`, and `pbi connect`.
Prerequisites
pipx install pbi-cli-tool pbi-cli skills install pbi connect
Tables
pbi table list # List all tables pbi table get Sales # Get table details pbi table create Sales --mode Import # Create table pbi table delete OldTable # Delete table pbi table rename OldName NewName # Rename table pbi table refresh Sales --type Full # Refresh table data pbi table schema Sales # Get table schema pbi table mark-date Calendar --date-column Date # Mark as date table
Columns
pbi column list --table Sales # List columns pbi column get Amount --table Sales # Get column details pbi column create Revenue --table Sales --data-type double --source-column Revenue # Data column pbi column create Profit --table Sales --expression "[Revenue]-[Cost]" # Calculated pbi column delete OldCol --table Sales # Delete column pbi column rename OldName NewName --table Sales # Rename column
Measures
pbi measure list # List all measures pbi measure list --table Sales # Filter by table pbi measure get "Total Revenue" --table Sales # Get details pbi measure create "Total Revenue" -e "SUM(Sales[Revenue])" -t Sales # Basic pbi measure create "Revenue $" -e "SUM(Sales[Revenue])" -t Sales --format-string "\$#,##0" # Formatted pbi measure create "KPI" -e "..." -t Sales --folder "Key Measures" --description "Main KPI" # With metadata pbi measure update "Total Revenue" -t Sales -e "SUMX(Sales, Sales[Qty]*Sales[Price])" # Update expression pbi measure delete "Old Measure" -t Sales # Delete pbi measure rename "Old" "New" -t Sales # Rename pbi measure move "Revenue" -t Sales --to-table Finance # Move to another table
**Multi-line DAX in measure expressions:** The `-e` flag passes DAX as a shell argument, which collapses newlines. For simple expressions like `SUM(Sales[Amount])` or `DIVIDE([A] - [B], [B])` this works fine. For complex expressions using VAR/RETURN, pipe from stdin instead:
echo 'VAR TotalSales = SUM(Sales[Amount]) VAR TotalCost = SUM(Sales[Cost]) RETURN TotalSales - TotalCost' | pbi measure create "Profit" -e - -t Sales
See the **power-bi-dax** skill for the full explanation and more workarounds.
Relationships
pbi relationship list # List all relationships pbi relationship get RelName # Get details pbi relationship create \ --from-table Sales --from-column ProductKey \ --to-table Products --to-column ProductKey # Create relationship pbi relationship delete RelName # Delete pbi relationship find --table Sales # Find relationships for a table pbi relationship activate RelName # Activate pbi relationship deactivate RelName # Deactivate
Hierarchies
pbi hierarchy list --table Date # List hierarchies pbi hierarchy get "Calendar" --table Date # Get details pbi hierarchy create "Calendar" --table Date # Create pbi hierarchy delete "Calendar" --table Date # Delete
Calculation Groups
pbi calc-group list # List calculation groups pbi calc-group create "Time Intelligence" --description "Time calcs" # Create group pbi calc-group items "Time Intelligence" # List items pbi calc-group create-item "YTD" \ --group "Time Intelligence" \ --expression "CALCULATE(SELECTEDMEASURE(), DATESYTD(Calendar[Date]))" # Add item pbi calc-group delete "Time Intelligence" # Delete group
Creating a Date/Calendar Table
Date tables are essential for time intelligence functions (TOTALYTD, SAMEPERIODLASTYEAR, DATEADD, etc.).
# Create a calculated date table with DAX (covers full calendar years) pbi table create Calendar \ --dax-expression "ADDCOLUMNS(CALENDAR(DATE(2023,1,1), DATE(2024,12,31)), \"Year\", YEAR([Date]), \"MonthNumber\", MONTH([Date]), \"MonthName\", FORMAT([Date], \"MMMM\"), \"Quarter\", \"Q\" & FORMAT([Date], \"Q\"))" # Mark it as a date table (required for time intelligence) pbi table mark-date Calendar --date-column Date # Verify it's recognized as a date table pbi calendar list
Workflow: Create a Star Schema
# 1. Create fact table pbi table create Sales --mode Import # 2. Create dimension tables pbi table create Products --mode Import pbi table create Calendar --mode Import # 3. Create relationships pbi relationship create --from-table Sales --from-column ProductKey --to-table Products --to-column ProductKey pbi relationship create --from-table Sales --from-column DateKey --to-table Calendar --to-column DateKey # 4. Mark date table pbi table mark-date Calendar --date-column Date # 5. Add measures pbi measu
Power BI CLI - semantic models (.NET TOM) and PBIR reports for token-efficient AI agent usage, built for Claude Code
Repo: MinaSaad1/pbi-cli
Other skills on pbi-cli.
- /power-bi-custom-visuals
Vibe-code Power BI custom visuals end-to-end: scaffold a TypeScript project, iterate on src/visual.ts and capabilities.json, validate with the Power BI Visuals SDK toolchain, package to .pbiviz, and import into a PBIR report. Invoke this skill whenever the user mentions "custom
Open skill - /power-bi-dax
Write, execute, and optimize DAX queries and measures for Power BI semantic models using pbi-cli. Invoke this skill whenever the user mentions DAX, queries data in Power BI, writes calculations, creates measures, asks about EVALUATE, SUMMARIZECOLUMNS, CALCULATE, time
Open skill - /power-bi-deployment
Import and export TMDL/TMSL formats, manage model lifecycle with transactions, and version-control Power BI semantic models using pbi-cli. Invoke this skill whenever the user mentions "deploy", "export", "import", "TMDL", "TMSL", "version control", "git", "backup", "migrate",
Open skill - /power-bi-diagnostics
Troubleshoot Power BI model performance, trace query execution, manage caches, and verify the pbi-cli environment using pbi-cli. Invoke this skill whenever the user says "pbi not working", "setup issues", "connection failed", "slow query", "performance", "profiling", "tracing",
Open skill - /power-bi-docs
Auto-document Power BI semantic models by extracting metadata, generating documentation, and cataloging all model objects using pbi-cli. Invoke this skill whenever the user says "document this model", "what's in this model", "list everything", "data dictionary", "model
Open skill - /power-bi-filters
Add, remove, and manage page-level and visual-level filters on Power BI PBIR reports using pbi-cli. Invoke this skill whenever the user mentions "filter", "TopN filter", "top 10", "bottom 5", "relative date filter", "last 30 days", "categorical filter", "include values",
Open skill

