minasaad1/pbi-cli/power-bi-visuals

Claude Code and agent skill by minasaad1/pbi-cli

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Add, configure, bind data to, and bulk-manage visuals on Power BI PBIR report pages using pbi-cli. Invoke this skill whenever the user mentions "add a chart", "bar chart", "line chart", "card", "KPI", "gauge", "scatter", "table visual", "matrix", "slicer", "combo chart", "bind data", "visual type", "visual layout", "resize visuals", "bulk update visuals", "bulk delete", "visual calculations", or wants to place, move, bind, or remove any visual on a report page. Also invoke when the user asks wh…

Install

npx vskill@latest install minasaad1/pbi-cli/power-bi-visuals

SKILL.md

Power BI Visuals Skill

Create and manage visuals on PBIR report pages. No Power BI Desktop connection is needed -- these commands operate directly on JSON files.

Adding Visuals

bash
# Add by alias (pbi-cli resolves to the PBIR type)
pbi visual add --page page_abc123 --type bar
pbi visual add --page page_abc123 --type card --name "Revenue Card"
# Custom position and size (pixels)
pbi visual add --page page_abc123 --type scatter \
--x 50 --y 400 --width 600 --height 350
# Named visual for easy reference
pbi visual add --page page_abc123 --type combo --name sales_combo

Each visual is created as a folder with a visual.json file inside the page's visuals/ directory. The template includes the correct schema URL and queryState roles for the chosen type.

Prerequisite: Measures Must Exist in the Semantic Model

visual bind writes field references into the visual JSON. It does not create measures — it only records that a measure should exist. If the measure is missing from the TMDL, every visual bound to it will show an error in Desktop.

Before binding any visual to a measure, verify the measure exists:

bash
# Option A: create it via pbi-cli (requires pbi connect)
pbi connect
pbi measure create "Total Revenue" -e "SUM(Fact_Sales[Total_Revenue])" -t Fact_Sales
# Option B: check existing measures in the TMDL file directly
# Look for `measure '...' =` lines in SemanticModel/definition/tables/*.tmdl

After adding measures directly to a TMDL file (without pbi connect): close and reopen the .pbip file in Power BI Desktop. Desktop only reads TMDL on file open — it does not hot-reload TMDL changes made on disk.

Checklist before opening Desktop:

  • Every --field, --value, --indicator reference points to a real measure or column in the TMDL
  • Table names match exactly (case-sensitive in PBIR): "Fact_Sales" ≠ "fact_sales"
  • Measure names match exactly: "Total Revenue" ≠ "Total_Revenue"

Binding Data

Visuals start empty. Use visual bind with Table[Column] notation to connect them to your semantic model. The bind options vary by visual type -- see the type table below.

bash
# Bar chart: category axis + value
pbi visual bind mybar --page p1 \
--category "Geography[Region]" --value "Sales[Revenue]"
# Card: single field
pbi visual bind mycard --page p1 --field "Sales[Total Revenue]"
# Matrix: rows + values + optional column
pbi visual bind mymatrix --page p1 \
--row "Product[Category]" --value "Sales[Amount]" --value "Sales[Quantity]"
# Scatter: X, Y, detail, optional size and legend
pbi visual bind myscatter --page p1 \
--x "Sales[Quantity]" --y "Sales[Revenue]" --detail "Product[Name]"
# Combo chart: category + column series + line series
pbi visual bind mycombo --page p1 \
--category "Calendar[Month]" --column "Sales[Revenue]" --line "Sales[Margin]"
# KPI: indicator + goal + trend axis
pbi visual bind mykpi --page p1 \
--indicator "Sales[Revenue]" --goal "Sales[Target]" --trend "Calendar[Date]"
# Gauge: value + max/target
pbi visual bind mygauge --page p1 \
--value "Sales[Revenue]" --max "Sales[Target]"

Binding uses ROLE_ALIASES to translate friendly names like --value into the PBIR role name (e.g. Y, Values, Data). Each field is written as a Column or a Measure reference based on what it actually is in the semantic model, checked in this order:

  1. The report's own semantic model on disk (definition.pbir -> byPath ->

tables/*.tmdl or model.bim)

  1. The live model from pbi connect, only for fields not found on disk
  2. A role default: slicers and table --column bind Columns; value, indicator and

goal roles bind Measures; category, row and legend bind Columns

The JSON output reports kind and resolved_by per field, plus a warnings entry when a field is missing from the model (usually a typo). Force the wrapper for every field in one call with --kind column or --kind measure.

Columns bound to a value role get the implicit aggregation Desktop would apply, taken from the column's summarizeBy (Sum for numeric columns by default). Text columns count on charts and matrices and stay as plain columns in tables and cards. Category, row, legend and slicer fields are never aggregated. Override with --aggregation:

bash
# Average price per region instead of the model's default Sum
pbi visual bind mybar --page p1 \
--category "Geography[Region]" --value "Sales[Price]" --aggregation average
bash
# Slicer on a dimension column (written as Column)
pbi visual bind myslicer --page p1 --field "Geography[Region]"
# Table mixing columns and measures (each resolved from the model)
pbi visual bind mytable --page p1 --column "Geography[Region]" --column "Product[Name]" --value "Sales[Revenue]"

Inspecting and Updating

bash
# List all visuals on a page
pbi visual list --page page_abc123
# Get full details of one visual
pbi visual get visual_def456 --page page_abc123
# Move, resize, or toggle visibility
pbi visual update vis1 --page p1 --width 600 --height 400
pbi visual update vis1 --page p1 --x 100 --y 200
pbi visual update vis1 --page p1 --hidden
pbi visual update vis1 --page p1 --visible
# Delete a visual
pbi visual delete visual_def456 --page page_abc123

Container Properties

Set border, background, or title on the visual container itself:

bash
pbi visual set-container vis1 --page p1 --background "#F0F0F0"
pbi visual set-container vis1 --page p1 --border-color "#CCCCCC" --border-width 2
pbi visual set-container vis1 --page p1 --title "Sales by Region"

Visual Calculations

Add DAX calculations that run inside the visual scope:

bash
pbi visual calc-add vis1 --page p1 --role Values \
--name "RunningTotal" --expression "RUNNINGSUM([Revenue])"
pbi visual calc-list vis1 --page p1
pbi visual calc-delete vis1 --page p1 --name "RunningTotal"

Bulk Operations

Operate on many visuals at once by filtering with --type or --name-pattern:

bash
# Find visuals matching criteria
pbi visual where --page overview --type barChart
pbi visual where --page overview --type kpi --y-min 300
# Bind the same field to ALL bar charts on a page
pbi visual bulk-bind --page overview --type barChart \
--category "Date[Month]" --value "Sales[Revenue]"
# Resize all KPI cards
pbi visual bulk-update --page overview --type kpi --width 250 --height 120
# Hide all visuals matching a pattern
pbi visual bulk-update --page overview --name-pattern "Temp_*" --hidden
# Delete all placeholders
pbi visual bulk-delete --page overview --name-pattern "Placeholder_*"

Filter options for where, bulk-bind, bulk-update, bulk-delete:

  • --type -- PBIR visual type or alias (e.g. barChart, bar)
  • --name-pattern -- fnmatch glob on visual name (e.g. Chart_*)
  • --x-min, --x-max, --y-min, --y-max -- position bounds (pixels)

All bulk commands require at least --type or --name-pattern to prevent accidental mass operations.

Supported Visual Types (32)

Charts
AliasPBIR TypeBind Options
barbarChart--category, --value, --legend
linelineChart--category, --value, --legend
columncolumnChart--category, --value, --legend
areaareaChart--category, --value, --legend
ribbonribbonChart--category, --value, --legend
waterfallwaterfallChart--category, --value, --breakdown
stacked_barstackedBarChart--category, --value, --legend
clustered_barclusteredBarChart--category, --value, --legend
clustered_columnclusteredColumnChart--category, --value, --legend
scatterscatterChart--x, --y, --detail, --size, --legend
funnelfunnelChart--category, --value
combolineStackedColumnComboChart--category, --column, --line, --legend
donut / piedonutChart--category, --value, --legend
treemaptreemap--category, --value
Cards and KPIs
AliasPBIR TypeBind Options
cardcard--field
card_visualcardVisual--field (modern card)
card_newcardNew--field
multi_row_cardmultiRowCard--field
kpikpi--indicator, --goal, --trend
gaugegauge--value, --max / --target
Tables
AliasPBIR TypeBind Options
tabletableEx--value
matrixpivotTable--row, --value, --column
Slicers
AliasPBIR TypeBind Options
slicerslicer--field
text_slicertextSlicer--field
list_slicerlistSlicer--field
advanced_sliceradvancedSlicerVisual--field (tile/image slicer)
Maps
AliasPBIR TypeBind Options
azure_map / mapazureMap--category, --size
Decorative and Navigation
AliasPBIR TypeBind Options
action_buttonactionButton(no data binding)
imageimage(no data binding)
shapeshape(no data binding)
textboxtextbox(no data binding)
page_navigatorpageNavigator(no data binding)

Suppressing Auto-Sync (--no-sync)

By default, every write command automatically syncs Power BI Desktop. When adding or binding many visuals in sequence, Desktop reloads after each one.

Use --no-sync on the visual command group to batch all changes, then call pbi report reload once at the end:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
483
Repository forks
123
7-day trend score
30

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/minasaad1/pbi-cli/power-bi-visuals/badge)](https://verified-skill.com/skills/minasaad1/pbi-cli/power-bi-visuals)

Something wrong with this skill or its page? Tell us.