Skip to main content
ClaudeWave
Skill711 repo starsupdated today

powerbi-custom-visuals

The powerbi-custom-visuals skill provides a complete TypeScript development environment for building distributable Power BI custom visuals (.pbiviz files) using the pbiviz CLI toolchain. Use it when creating reusable, interactive visuals with custom formatting panes that need to be packaged, certified, and published to AppSource, rather than building one-off charts directly in reports with Deneb, Python, R, or SVG approaches.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/data-goblin/power-bi-agentic-development /tmp/powerbi-custom-visuals && cp -r /tmp/powerbi-custom-visuals/plugins/custom-visuals/skills/powerbi-custom-visuals ~/.claude/skills/powerbi-custom-visuals
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Power BI Custom Visuals (pbiviz)

Build distributable Power BI **developer visuals**: TypeScript/D3 visuals packaged
as a `.pbiviz` file, written against the `powerbi-visuals-api` and built with the
`pbiviz` CLI (`powerbi-visuals-tools`). This skill covers the full loop: scaffold,
develop, live-preview, package, certify, and publish.

## Pick the right tool first

This plugin holds five visual approaches. Choose before building:

```yaml
deneb-visuals:    no-code Vega / Vega-Lite specs inside a report; no packaging, no TypeScript
python-visuals:   matplotlib / seaborn script visuals (static image, computes at render)
r-visuals:        ggplot2 script visuals (static image); R's stats ecosystem
svg-visuals:      SVG drawn by a DAX measure (ImageUrl); inline in tables/cards, no visual sandbox
powerbi-custom-visuals (this skill): a real .pbiviz developer visual, reusable across
                  reports and shareable on AppSource; full interactivity, formatting pane, certification
```

Reach for this skill when the need is a reusable, interactive, distributable visual
with its own formatting pane. For a one-off chart in a single report, a sibling
skill is usually faster and lighter.

## Prerequisites

- Node.js 20.19 or later (the `powerbi-visuals-tools` engine minimum)
- `pbiviz` CLI: run via `npx -y powerbi-visuals-tools <command>`, or install it globally
- Developer mode for live preview: enable the developer visual in Power BI Desktop, or
  turn on developer mode in the Power BI service

## Core workflow

1. **Scaffold**: `pbiviz new <VisualName>` creates the project (`src/visual.ts`,
   `capabilities.json`, `pbiviz.json`, `tsconfig.json`, `package.json`, `style/`, `assets/`)
2. **Implement the visual class** in `src/visual.ts`. Implement the `IVisual` interface;
   the class name must equal `visualClassName` in `pbiviz.json`. Core methods:
   `constructor` (set up DOM and services), `update` (render on data/size/settings change),
   `getFormattingModel` (populate the format pane), `destroy` (cleanup)
3. **Declare data and formatting** in `capabilities.json`: `dataRoles` (the field wells),
   `dataViewMappings` (how roles map to the dataView), and `objects` (format-pane properties)
4. **Build the formatting model** with `powerbi-visuals-utils-formattingmodel`
   (`FormattingSettingsService`, cards, slices). A card name matches a `capabilities.json`
   object; a slice name matches a property
5. **Live-preview**: `pbiviz start`, then add the developer visual to a report and iterate
   against real data
6. **Package**: `pbiviz package` produces the `.pbiviz` under `dist/`; import it into a report

Full command flags, the project layout, the `IVisual` lifecycle, and formatting-model
patterns are in `references/pbiviz-toolchain.md`.

## Use the bundled pbiviz MCP server

This plugin ships a `.mcp.json` that starts the `pbiviz` MCP server
(`npx -y powerbi-visuals-tools mcp`). It grounds development in current, correct API
usage instead of guessed code. Prefer its tools while building:

```yaml
get_available_apis:    look up data, formatting, interaction, and utility APIs with examples
get_best_practices:    API-version management, performance, security, accessibility, testing
add_feature:           list features available to add (bookmarks, tooltips, drill-down, selection, localization)
implement_feature:     step-by-step instructions, code templates, and config changes for a feature
list_visual_info:      extract a project's GUID, version, author, data roles, dependencies
check_vulnerabilities: scan dependencies and source for risky patterns (eval, innerHTML)
prepare_certification: verify required files, configuration, capabilities, and assets pre-submission
```

Setup, client config, and per-tool detail are in `references/mcp-server.md`.

## Certify and publish

Certification unlocks export to PowerPoint and email subscriptions, and signals a
reviewed visual. Key gates: a lowercase `certification` branch matching the package,
`eslint-plugin-powerbi-visuals` passing, no `eval`/`fetch`/`XMLHttpRequest`, a clean
`npm audit`, and the latest API. Audit with `pbiviz package --certification-audit`.
Publishing goes through Partner Center to AppSource. R-based visuals cannot be certified.

Requirements and the submission flow are in `references/certification-publishing.md`.

## Learn from shipped visuals

Microsoft publishes the full source of official and certified visuals. Start from the
tutorials (`circlecard`, `sampleBarChart`) and read a production visual close to the
target (`gantt`, `sankey`, `sunburst`, `timeline`, `ChicletSlicer`) for real patterns.
A curated list with what each one teaches is in `references/community-examples.md`.

## Additional resources

### Reference files
- **`references/pbiviz-toolchain.md`** ... CLI commands, project structure, IVisual lifecycle, capabilities.json, formatting model, key npm packages
- **`references/mcp-server.md`** ... the bundled pbiviz MCP: setup and its tools
- **`references/certification-publishing.md`** ... certification requirements and AppSource publishing
- **`references/community-examples.md`** ... official and certified example visuals worth reading

### Examples
- **`examples/vscode-mcp.json`** ... standalone `.vscode/mcp.json` for a visual project outside this plugin
- **`examples/capabilities-objects.json`** ... a `capabilities.json` `objects` block wired to a formatting card
audit-tenant-settingsSkill

Automatically invoke this skill whenever the user asks about Fabric tenant settings or Power BI tenant settings or auditing tenant settings. You can use this skill if the user mentions "Fabric administration".

fabric-cliSkill

Expert guidance for using the Fabric CLI (`fab`) to fully interact with Fabric workspaces, items, and configuration. Automatically invoke this skill whenever the user mentions "Fabric" or "Power BI Service" or a "Fabric/Power BI workspace".

connect-pbidSkill

TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field parameters, query tracing, DAX library package management (daxlib.org), and the Desktop Bridge for reloading and screenshotting the report canvas. Automatically invoke when the user mentions "Power BI Desktop", "Analysis Services port", "TOM", "ADOMD", "daxlib", "DAX library", "DAX UDF package", or asks to "connect to PBI Desktop", "query PBI Desktop with DAX", "modify PBI Desktop model", "add a measure to PBI", "capture visual queries", "create a field parameter", "validate DAX", "intercept DAX queries", "install daxlib", "add DAX SVG", "add IBCS", "reload the report canvas", "screenshot a report page", "Desktop Bridge", or to work with the model and report in Power BI Desktop together.

pbipSkill

Expert guidance for the Power BI Project (PBIP) file format; project structure, cross-cutting operations (renames, forking), and PBIX extraction/conversion. Automatically invoke when the user mentions PBIP, PBIX, .pbip/.pbism/.platform files, or asks about "PBIP project structure", "PBIP vs PBIX", "thin report vs thick report", "rename a table", "cascade rename", "fork a PBIP project", "convert pbix to pbip", "extract pbix", "what files are in a PBIP", "PBIP encoding", "definition.pbir", or discusses project-level file structure and post-rename verification.

pbir-formatSkill

Format reference for Power BI Enhanced Report (PBIR) JSON schemas and patterns. Automatically invoke when the user asks about PBIR JSON structure, visual.json properties, PBIR expressions, objects vs visualContainerObjects, theme inheritance, conditional formatting patterns, extension measures, bookmarks, field references, filter formatting, query roles, PBIR page structure, report wallpaper, or any PBIR metadata format question.

tmdlSkill

Direct TMDL file authoring and BIM-to-TMDL conversion for semantic models in PBIP projects. Automatically invoke when the user asks to "edit TMDL", "add a measure in TMDL", "TMDL syntax", "fix formatString", "fix summarizeBy", "TMDL indentation", "convert BIM to TMDL", "add a column description", "create a calculated column in TMDL", or mentions .tmdl file editing or BIM-to-TMDL migration.

create-pbi-reportSkill

Step-by-step workflow for creating complete Power BI reports from scratch using pbir CLI. Covers model discovery, report creation, page layout, theme setup, visual placement, field binding, filtering, formatting, validation, and publishing. Automatically invoke when the user asks to "create a new report", "build a report from scratch", "make a dashboard", "set up a report with KPIs", "create an executive dashboard", "add pages and visuals to a new report".

deneb-visualsSkill

Deneb visual creation, Vega/Vega-Lite spec authoring, and Deneb best practices for PBIR reports. Automatically invoke whenever the user mentions "Deneb" in any context, or asks about Vega/Vega-Lite specs in Power BI, Deneb cross-filtering, Deneb interactivity, pbiColor theme integration, Deneb field name escaping, or Deneb rendering issues.