/custom-visuals:deneb-visualsfrom custom-visuals
Creates and debugs Deneb custom visuals in Power BI using Vega/Vega-Lite specs. Covers spec authoring, cross-filtering, interactivity, pbiColor themes, field escaping, and rendering issues.
Ships in custom-visuals. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Report modification requires tooling. Two paths exist:
pbirCLI (preferred) -- use thepbircommand and thepbir-cliskill. Install withuv tool install pbir-cliorpip install pbir-clion macOS or Windows; on Linux run thepbir-cliskill'sbin/install-linux.sh, which installs the Windows build under Wine (path 2 only where there is no Wine). Check availability withpbir --version.- Direct JSON modification -- if
pbiris not available, use thepbir-formatskill (pbip plugin) for PBIR JSON structure and patterns. Validate every change withjq empty <file.json>.If neither the
pbir-cliskill nor thepbir-formatskill is loaded, ask the user to install the appropriate plugin before proceeding with report modifications.
Deneb is a certified custom visual for Power BI that enables Vega and Vega-Lite declarative visualization specs directly inside reports. Author specs using this skill.
Prefer Vega-Lite for new Deneb visuals unless specific Vega-only features are required (signals, event streams, custom projections, force/voronoi layouts). Vega-Lite is more concise, easier to maintain, and covers most chart types. For advanced Vega features, see references/vega-patterns.md and the Vega documentation.
A Vega-Lite spec that outgrows Vega-Lite can be converted in the 2.0 editor, one way only, so extract it first: references/editions-and-editor.md.
deneb7E15AEF80B9E4D4F8E12924291ECE89A (the AppSource, certified edition: the one this skill assumes)v6.json schema URLs) are in references/editions-and-editor.md.dataset role (all fields go into one "Values" well)dataLimit.override fetches more in 10,000-row batches during report viewing only, not in PDF or PowerPoint export.vegaLite (default) or vega (when Vega-specific features needed)svg (default, sharp text) or canvas (better for large datasets)dataLimit.enableIncrementalDataUpdates) and canvas stateManagement.scaleToZoom; see references/capabilities.md.Deneb 1.9 and 2.0.0.0 are both live. Until a report is confirmed on 2.0, author for both: the container signals follow the visual.json's developer.version stamp, $schema never goes inside jsonSpec, and a hand-authored visual leaves the 2.0 stamps out unless the spec needs them. The rules, the compatibility matrix, what 2.0 rewrites on first open and the audit and migrate commands are in references/deneb-2-migration.md.
Register deneb7E15AEF80B9E4D4F8E12924291ECE89A in report.json publicCustomVisuals array manually. Without this, the visual shows "Can't display this visual."
For more information, use the pbir-format skill and check the report.md reference.
{
"publicCustomVisuals": ["deneb7E15AEF80B9E4D4F8E12924291ECE89A"]
}
With pbir, copy an existing Deneb visual (references/pbir-structure.md). Otherwise create the visual.json file manually (see pbir-format skill in the pbip plugin for JSON structure) with visualType: deneb7E15AEF80B9E4D4F8E12924291ECE89A, field bindings for the columns and measures you need, and position/size as required.
All fields bind to the single dataset role. Use Table.Column for columns and Table.Measure for measures. Field names in bindings must match those used in the Vega/Vega-Lite spec.
Create a Vega-Lite (or Vega) JSON spec file. Key difference:
"data": {"name": "dataset"} (object)"data": [{"name": "dataset"}] (array){
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"y": {"field": "Category", "type": "nominal"},
"x": {"field": "Value", "type": "quantitative"}
}
}
See examples/spec/ for complete spec files (Vega and Vega-Lite) and examples/visual/ for full PBIR visual.json files. Field names in the spec must match the display label in the Values well: displayName when the projection sets one, otherwise nativeQueryRef (which is the field's real native name in the model). See the field-naming contract in references/pbir-structure.md.
Set the spec and config in the visual's objects.vega[0].properties as single-quoted DAX literal strings. The jsonSpec property holds the Vega spec (stringified JSON), jsonConfig holds the config, and provider is set to 'vega' or 'vegaLite'. See the PBIR structure reference (references/pbir-structure.md) for the full encoding pattern.
Escaping rules for visual.json injection:
The spec JSON must be stringified into a single line and wrapped in single quotes inside the expr.Literal.Value:
"jsonSpec": {"expr": {"Literal": {"Value": "'{\"data\":[{\"name\":\"dataset\"}],\"marks\":[...]}'" }}}
$schema removed, inner " escaped as \", the whole wrapped in '...'; field names with spaces in expressions use doubled single quotes (datum[''Sales Amount'']). deneb_spec.py embed does all of it; examples/visual/ has real filesBefore presenting the spec to the user, dispatch the deneb-reviewer agent to validate syntax and provide design feedback.
Validate JSON syntax with jq empty <visual.json>, then run python deneb_spec.py audit <visual.json> (deneb-pbir skill) for a one-line 2.0 readiness verdict (build stamp, provider, signal family, embedded $schema, leftovers, context menu, field configuration). Then inspect the visual.json to confirm spec content and field bindings.
With Desktop open, finish in the 2.0 debug pane (Source tab Ctrl+Alt+6, Data tab Ctrl+Alt+7); without it, render offline with the deneb-pbir skill's render.mjs. What each tab shows: references/editions-and-editor.md.
"data": [{"name": "dataset"}] (array form)"data": {"name": "dataset"} (object form)., [, ], \, ") become _"Order Lines")Escaping depends on whether the spec is standalone or injected into a PBIR visual.json:
Standalone spec files (in examples/spec/): use double quotes with JSON escaping:
{"calculate": "datum[\"Order Lines\"] - datum[\"Order Lines (PY)\"]", "as": "diff"}
Inside PBIR visual.json (in examples/visual/): the entire spec is a single-quoted DAX literal string. Field names with spaces use doubled single quotes (''):
datum[''Order Lines''] - datum[''Order Lines (PY)'']
Single quotes that are NOT part of field name escaping (e.g., string literals in filter expressions like datum.Series == 'Actuals') work as-is because they don't conflict with the outer single-quote wrapper.
An apostrophe inside a data string is different: a colour domain listing Queen's Pawn Game must carry it doubled (Queen''s Pawn Game) in the stored literal. When generating the literal from a spec object, double every single quote, "'" + json.dumps(spec).replace("'", "''") + "'", which also produces the field-name form above; Power BI un-doubles on load.
Use Deneb's built-in signals for responsive container sizing. Two names exist for the same thing:
"width": {"signal": "pbiContainerWidth - 25"},
"height": {"signal": "pbiContainerHeight - 27"}
"width": {"signal": "denebContainer.width - 25"},
"height": {"signal": "denebContainer.height - 27"}
The offsets account for padding. For absolute positioning of text marks, use {"signal": "width"} instead of hardcoded pixel values.
denebContainer properties: references/editions-and-editor.md.denebContainer.* only when the visual.json carries developer.version 2.0.0.0 or later; otherwise the legacy pair (transition rules).Always provide a config file for consistent styling. See the Standard Config section in references/vega-patterns.md. Key settings: autosize: fit, view.stroke: transparent, font: Segoe UI.
Use Power BI theme colors instead of hardcoded hex values:
| Function/Scheme | Purpose | Usage in Vega |
|---|---|---|
pbiColor(index) | Theme color by index (0-based) | {"signal": "pbiColor(0)"} |
pbiColor(0, -0.3) | Darken theme color by 30% | Shade: -1 (dark) to 1 (light) |
pbiColor("negative") | Sentiment colors | "negative", "neutral", "positive" |
pbiColor("min") | Divergent colors | "min", "middle", "max" |
pbiColor("bad") | The only two aliases | "bad" = "negative", "good" = "positive"; "neutral" is its own name, not "middle" |
pbiColorNominal | Categorical palette (distinct) | "range": {"scheme": "pbiColorNominal"} |
pbiColorOrdinal | Ordinal palette (ordered categories) | "range": {"scheme": "pbiColorOrdinal"} |
pbiColorLinear | Continuous gradient | "range": {"scheme": "pbiColorLinear"} |
pbiColorDivergent | Divergent gradient | "range": {"scheme": "pbiColorDivergent"} |
Those eight names are the whole set; an unknown name lands on theme color 1 (references/expression-functions.md). pbiColorDivergent never reaches the center color (why).
Deneb registers six Vega expression functions: pbiColor, pbiFormat, pbiFormatAutoUnit, pbiPatternSVG, pbiCrossFilterApply and pbiCrossFilterClear. pbiFormat takes a Power BI format string, not d3; in Vega-Lite set "formatType": "pbiFormat" wherever format is accepted. Signatures, the 2.0 locale trimming and the canvas limit on patterns are in references/expression-functions.md.
Enable interactivity via the vega objects in visual.json:
| Feature | Property | Default | Notes |
|---|---|---|---|
| Tooltips | enableTooltips | true | Vega: "tooltip": {"signal": "datum"} in encode. Vega-Lite: "mark": {"tooltip": true}. Report-page tooltips need __row__ in the datum. tooltipDelay (ms, default 0) exists. Sentence-template tooltips need the fields listed explicitly (reference) |
| Context menu shown | enableContextMenu | true | 2.0: whether the Power BI right-click menu appears at all; false swallows right-click so the spec can own it. Pre-2.0 it meant "no data-point resolution" |
| Context menu data points | enableContextMenuSelector | true | New in 2.0. Whether Deneb resolves the clicked datum for drill-through. Lives under objects.vega |
| Cross-filtering | enableSelection | false | Requires __selected__ handling |
| Cross-highlighting | enableHighlight | false | Measures get <field>__highlight; status and comparator are opt-in on 2.0-stamped visuals |
Context menu: never author enableContextMenu false unless the menu should be suppressed under 2.0; for a menu without data-point resolution write enableContextMenu true + enableContextMenuSelector false. Why, and the sentence-template tooltip note: references/interactivity-and-runtime-fields.md.
When enableSelection is true, handle __selected__ ("on", "off", "neutral") in encode blocks. Selection modes: simple (auto-resolves, selectionMaxDataPoints 1-250, default 50) or advanced (Vega only; required for brush/lasso/region selection, supports up to 2500 via options.limit, and exposes the expression functions pbiCrossFilterApply(event, filter?, options?) and pbiCrossFilterClear(), called from a signal's update expression). See references/vega-patterns.md for the simple pattern and references/advanced-patterns.md for the advanced API.
Use layered marks -- background at reduced opacity, foreground shows <field>__highlight values. See references/vega-patterns.md for details.
Deneb injects runtime fields into each dataset row. See references/capabilities.md for the full table.
Key fields: __row__ (zero-based row index, always present, replaces removed __identity__), __selected__ (selection state, only when enableSelection is on), <field>__highlight + <field>__highlightStatus + <field>__highlightComparator (cross-highlighting, measures only), <field>__formatted (pre-formatted value string), <field>__format (Power BI format string), <parameter>__names (component display names of a consolidated field parameter, 2.0).
Which per-field ones exist depends on whether the visual is unstamped, migrated or stamped 2.0, and consolidated field parameters make them arrays: references/interactivity-and-runtime-fields.md.
Breaking change in 1.9:
__identity__and__key__were removed. Replace anydatum.__identity__withdatum.__row__.
With consolidation on, Deneb 2.0 merges a field parameter's components into one array column named after the parameter, unpacked with a flatten transform. It is off for migrated and unstamped visuals, and 2.0 only. The PBIR shape, the stamps that turn it on and the Vega form are in references/field-parameters.md.
Deneb cannot fetch anything (an image, a dataset, a font) outside the uncertified standalone build, and a blocked resource renders blank with no error. data: URIs work, but data:image/svg+xml;utf8, is rejected: emit ;charset=utf-8,. Details: references/images-and-external-resources.md.
Read references/gotchas.md and references/silent-traps.md before debugging a Deneb visual that renders blank, wrong or clipped. The ones that bite most:
nativeQueryRef is not a rename.deneb-pbir round-trip tooling, never by hand.width/height in a spec: autosize: fit sizes it from the container.autosize: fit in config for responsive Power BI sizingpbiColor, pbiColorNominal) instead of hex valuesenter/update/hover encode blocks for clean state management (Vega only)"tooltip": {"signal": "datum"} on marksrenderMode: canvas for many marks, and only then raise dataLimit.override. See references/advanced-patterns.md for the full lever orderdisplayName when set, otherwise nativeQueryRef) matches spec field referencesconfig, not the theme (references/gotchas.md).Deneb is the preferred choice for advanced custom visuals that need interactivity (cross-filtering, tooltips, hover effects) and go beyond what native Power BI visuals offer. Use Deneb when you need:
Absence from the native set means Deneb can draw the form, not that it suits the reader (the form gate is pbi-report-design's references/chart-selection.md).
The house split: native visuals for anything people interact with, Deneb for display-only KPIs. Charts, tables and slicers people click stay native. A KPI nobody clicks is where Deneb earns its place: one tile can combine figures that would otherwise take four cards. Do not turn an interactive visual into static Deneb art.
Use SVG measures instead for simple inline graphics in tables/cards (sparklines, data bars, progress bars) where interactivity is not needed. Use Python/R instead for statistical visualizations (distribution analysis, regression, correlation) where the focus is analytical rigor over interactivity.
references/community-examples.md -- 170+ community templates organized by chart type, with author citations and direct linksreferences/vega-patterns.md -- Vega chart patterns (bar, line, scatter, donut, stacked, heatmap, area, lollipop, bullet, KPI card), standard config, transforms and scales referencereferences/vega-lite-patterns.md -- Vega-Lite chart patterns (for editing existing Vega-Lite visuals only)references/pbir-structure.md -- PBIR JSON structure (literal encoding, query state, the field-naming contract of displayName vs nativeQueryRef and its all-blank-skeleton failure, interactivity example)references/capabilities.md -- Full Deneb 2.0 object properties reference (with 1.9 deltas), template format (usermeta v2 schema, v1 legacy shape) and the supporting-fields defaults matrixreferences/deneb-2-migration.md -- Deneb 2.0 migration and compatibility: timeline, what 2.0 changes on first open, compatibility matrix, authoring rules during the transition, audit/migrate commands, docs errors and unverified claims, the dated follow-up for flipping the defaultsreferences/silent-traps.md -- Silent failures: report-page tooltip row resolution and hover bands, the container clip rect and the padded re-render that catches it, field-well grain, the dataset entry's format, certified loader, template placeholders, Vega-Lite compiler traps, Vega rendering traps, rendering outside Denebreferences/gotchas.md -- Hard-won gotchas: field names, cross-filtering out, Vega-Lite offsets and fontWeight, size signals, hierarchy sort, keyboard focus, tooltips, titlesreferences/editions-and-editor.md -- Editions and GUIDs, bundled Vega versions, Vega-Lite to Vega, container-signal rewriting, the 2.0 debug panereferences/expression-functions.md -- The six expression functions, pbiFormat in Vega-Lite, locale trimming, pbiColor namesreferences/interactivity-and-runtime-fields.md -- Sentence-template tooltips, the context menu, which supporting fields existreferences/field-parameters.md -- Field-parameter consolidation in 2.0: arrays, flatten, the PBIR shape, the stampsreferences/images-and-external-resources.md -- Why Deneb fetches nothing, and which data: URI prefixes loadreferences/advanced-patterns.md -- Advanced cross-filtering (Vega expression functions pbiCrossFilterApply/pbiCrossFilterClear), performance engineering lever order, and community template round-trip from the terminalexamples/visual/bullet-chart.json -- PBIR visual.json: faceted bullet chart with conditional indicators and cross-filtering (Vega-Lite)examples/visual/kpi-card.json -- PBIR visual.json: KPI card with layered text and conditional % change coloring (Vega-Lite)examples/visual/trend-line.json -- PBIR visual.json: dual-series line chart with fold transform and color/legend mapping (Vega-Lite)examples/visual/ytd-comparison.json -- PBIR visual.json: YTD vs target with dashed lines, endpoint labels, number formatting, and rank-based filtering (Vega-Lite)examples/spec/vega/ -- Standalone Vega spec files (bar-chart, line-chart) -- ready to inject into visual.json after escapingexamples/spec/vega-lite/ -- Standalone Vega-Lite spec files (bullet-chart, kpi-card) -- ready to inject after escapingexamples/standard-config.json -- Standard config for all Deneb specsTo retrieve current Power BI custom visual docs, use microsoft_docs_search + microsoft_docs_fetch (MCP) if available, otherwise search https://learn.microsoft.com and fetch the relevant pages. Search based on the user's request and run multiple searches as needed to ensure sufficient context before proceeding. Note: Vega/Vega-Lite docs live at vega.github.io (not MS Learn) -- use WebFetch for those.
performant-matrix -- diagnose a slow matrix before assuming Deneb; the bridge/native/Deneb decisiondeneb-pbir -- round-trip tooling for an existing spec: deneb_spec.py extract / embed / audit / migrate, and the offline renderer render.mjs to verify without Power BIpbir-format (pbip plugin) -- PBIR JSON format referencepbi-report-design -- Layout and design best practicesr-visuals -- R Script visuals (ggplot2)python-visuals -- Python Script visuals (matplotlib)svg-visuals -- SVG via DAX measures (lightweight inline graphics)examples/spec/vega-lite/bullet-chart.json (opens in a new tab)examples/spec/vega-lite/kpi-card.json (opens in a new tab)examples/spec/vega/bar-chart.json (opens in a new tab)examples/spec/vega/line-chart.json (opens in a new tab)examples/standard-config.json (opens in a new tab)examples/visual/bullet-chart.json (opens in a new tab)examples/visual/kpi-card.json (opens in a new tab)examples/visual/trend-line.json (opens in a new tab)examples/visual/ytd-comparison.json (opens in a new tab)examples/visual/ytd-line-chart.json (opens in a new tab)references/advanced-patterns.md (opens in a new tab)references/capabilities.md (opens in a new tab)references/community-examples.md (opens in a new tab)references/deneb-2-migration.md (opens in a new tab)references/editions-and-editor.md (opens in a new tab)references/expression-functions.md (opens in a new tab)references/field-parameters.md (opens in a new tab)references/gotchas.md (opens in a new tab)references/images-and-external-resources.md (opens in a new tab)references/interactivity-and-runtime-fields.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub insightfulanalytics/pbi_agentic_dev --plugin custom-visuals7 skills in this plugin
/deneb-pbirRound-trip TOOLING for Deneb specs in PBIR. Extract/embed the Vega/Vega-Lite spec in visual.json, offline-render it to PNG/SVG, audit a visual's Deneb 2.0 stamps and migrate container signal names. Use whenever a task edits a Deneb visual's spec ("edit the Deneb visual", patching jsonSpec) or needs it rendered without Power BI. Authoring rules live in custom-visuals:deneb-visuals./performant-matrixDiagnose a slow financial matrix before fixing it: separate row-dispatch cost from the per-cell format-string and conditional-formatting tax, then choose with the user between a bridge table, a native restructure or a Deneb grid. Use when a P&L or financial matrix is slow or will not render (SWITCH dispatch, a calculation group on rows, Performance Analyzer far above the DAX time)./powerbi-custom-visualsPower BI custom visual (.pbiviz) development with the pbiviz toolchain and its MCP server. Automatically invoke when the user mentions "custom visual", "pbiviz", "develop a Power BI visual", "powerbi-visuals-tools", "IVisual", "capabilities.json", "visual formatting model", "visual certification", "publish a visual to AppSource", or asks to scaffold, build, debug, package, certify, or publish a .pbiviz developer visual./python-visualsPython visual creation and matplotlib/seaborn patterns for PBIR reports. Automatically invoke when the user mentions "Python visual", "matplotlib in Power BI", "seaborn in Power BI", "pythonVisual", or asks to "create a Python visual", "add a matplotlib chart", "write a Python visual script"./r-visualsR visual creation and ggplot2 patterns for PBIR reports. Automatically invoke when the user mentions "R visual", "ggplot2", "ggplot in Power BI", or asks to "create an R visual", "add an R chart", "write an R visual script", "inject an R script into Power BI"./svg-visualsSVG generation via DAX measures and extension measures with ImageUrl data category for inline visualizations in PBIR reports, including ready templates for matrix and table cells, new card images and per-button images on the new button slicer. Automatically invoke when the user mentions "SVG visual", "DAX sparkline", "SVG measure", "inline graphics with DAX", "ImageUrl data category", "extension measure", or asks to create any DAX-generated chart (progress bars, bullet charts, KPI indicators, data bars, gauges, donut charts, lollipop charts, dumbbell charts, status pills, overlapping bars, boxplots, IBCS bars, jitter plots, box-and-whisker charts).Other plugins' skills for the same job