
Deneb Visuals
- 35 installs
- 836 repo stars
- Updated July 29, 2026
- data-goblin/power-bi-agentic-development
Author Deneb custom visuals in Power BI PBIR reports using Vega and Vega-Lite specs, including cross-filtering and theme color integration.
About
Guidance for creating Deneb custom visuals in PBIR reports by authoring Vega/Vega-Lite specifications with best practices for interactivity and theming. A developer uses it to build Deneb visuals with cross-filtering, pbiColor theme integration, and correct field escaping.
- Authors Vega/Vega-Lite specs for Deneb visuals
- Covers cross-filtering, interactivity, and pbiColor theming
Deneb Visuals by the numbers
- 35 all-time installs (skills.sh)
- Ranked #1,060 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/data-goblin/power-bi-agentic-development --skill deneb-visualsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 35 |
|---|---|
| repo stars | ★ 836 |
| Last updated | July 29, 2026 |
| Repository | data-goblin/power-bi-agentic-development ↗ |
What it does
Author Deneb custom visuals in Power BI PBIR reports using Vega and Vega-Lite specs, including cross-filtering and theme color integration.
Files
Deneb Visuals in Power BI (PBIR)
Report modification requires tooling. Two paths exist:
1. `pbir` CLI (preferred) -- use thepbircommand and thepbir-cliskill. Install withuv tool install pbir-cliorpip install pbir-cli. Check availability withpbir --version.
2. Direct JSON modification -- ifpbiris not available, use thepbir-formatskill (pbip plugin) for PBIR JSON structure and patterns. Validate every change withjq empty <file.json>.
>
If neither thepbir-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.
Provider Policy
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.
Visual Identity
- visualType:
deneb7E15AEF80B9E4D4F8E12924291ECE89A - Bundled runtime: Vega 6.2.0 / Vega-Lite 6.4.1 (since Deneb 1.8; use
v6.jsonschema URLs) - Data role: Single
datasetrole (all fields go into one "Values" well) - Default row limit: 10,000 rows (override via
dataLimit.override) - Provider:
vegaLite(default) orvega(when Vega-specific features needed) - Render modes:
svg(default, sharp text) orcanvas(better for large datasets)
Custom Visual Registration (Required)
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"]
}Workflow: Creating a Deneb Visual
Step 1: Add the Visual
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.
Step 2: Write the Spec
Create a Vega-Lite (or Vega) JSON spec file. Key difference:
- Vega-Lite:
"data": {"name": "dataset"}(object) - Vega:
"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 nativeQueryRef (display name) from the field bindings.
Step 3: Inject the Spec
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": "'{\"$schema\":\"...\",\"data\":{\"name\":\"dataset\"},\"marks\":[...]}'" }}}- The entire JSON spec is flattened to one line
- All inner double quotes (
") become\"(standard JSON string escaping) - The stringified JSON is wrapped in single quotes:
'...' - Field names with spaces inside Vega expressions use doubled single quotes:
datum[''Sales Amount''] - See
examples/visual/for complete real-world visual.json files showing this encoding
Step 3b: Review
Before presenting the spec to the user, dispatch the deneb-reviewer agent to validate syntax and provide design feedback.
Step 4: Validate
Validate JSON syntax with jq empty <visual.json> and inspect the visual.json to confirm spec content and field bindings.
Spec Authoring Rules
Data Binding
- Vega:
"data": [{"name": "dataset"}](array form) - Vega-Lite:
"data": {"name": "dataset"}(object form) - Fields reference display names. Special characters (
.,[,],\,") become_ - Spaces are NOT replaced -- field names keep their spaces (e.g.,
"Order Lines")
Field Name Escaping in Expressions (Critical)
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.
Responsive Sizing (Vega)
Use Deneb's built-in signals for responsive container sizing:
"width": {"signal": "pbiContainerWidth - 25"},
"height": {"signal": "pbiContainerHeight - 27"}The offsets account for padding. For absolute positioning of text marks, use {"signal": "width"} instead of hardcoded pixel values.
Config (Separate from Spec)
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.
Theme Integration
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 | "min", "middle", "max", "negative", "positive" |
pbiColor("bad") | Aliases for sentiment | "bad" = "negative", "good" = "positive", "neutral" = "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"} |
Interactivity
Enable interactivity via the vega objects in visual.json:
| Feature | Property | Default | Notes |
|---|---|---|---|
| Tooltips | enableTooltips | true | Use "tooltip": {"signal": "datum"} in encode |
| Context menu | enableContextMenu | true | Right-click drill-through |
| Cross-filtering | enableSelection | false | Requires __selected__ handling |
| Cross-highlighting | enableHighlight | false | Creates <field>__highlight fields |
Cross-Filtering
When enableSelection is true, handle __selected__ ("on", "off", "neutral") in encode blocks. Selection modes: simple (auto-resolves, up to 250 data points) or advanced (Vega only; required for brush/lasso/region selection, supports up to 2500 via options.limit, exposes pbiCrossFilterApply and pbiCrossFilterClear signals). See references/vega-patterns.md for the simple pattern and references/advanced-patterns.md for the advanced signal API.
Cross-Highlighting
Use layered marks -- background at reduced opacity, foreground shows <field>__highlight values. See references/vega-patterns.md for details.
Special Runtime Fields
Deneb injects runtime fields into each dataset row. See references/capabilities.md for the full table.
Key fields: __row__ (zero-based row index, replaces removed __identity__), __selected__ (selection state), <field>__highlight + <field>__highlightStatus + <field>__highlightComparator (cross-highlighting), <field>__formatted (pre-formatted value string), <field>__format (Power BI format string).
Breaking change in 1.9:__identity__and__key__were removed. Replace anydatum.__identity__withdatum.__row__.
Best Practices
1. Use Vega-Lite for new visuals unless Vega-specific features are needed (signals, events, force layouts) 2. Always use `autosize: fit` in config for responsive Power BI sizing 3. Use `pbiContainerWidth`/`pbiContainerHeight` signals for responsive Vega specs 4. Use theme colors (pbiColor, pbiColorNominal) instead of hex values 5. Use `enter`/`update`/`hover` encode blocks for clean state management (Vega only) 6. Enable tooltips with "tooltip": {"signal": "datum"} on marks 7. Performance -- aggregate in DAX first, prefer renderMode: canvas for many marks, and only then raise dataLimit.override. See references/advanced-patterns.md for the full lever order 8. Test field names -- verify nativeQueryRef matches spec field references 9. Avoid external data -- AppSource certification prevents loading external URLs 10. Escaping depends on context -- double quotes in standalone specs, doubled single quotes in PBIR visual.json (see escaping rules above)
When to Use Deneb
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:
- Custom chart types not available natively (bullet charts, beeswarms, sankeys, etc.)
- Fine-grained control over visual encoding, animation, and interactivity
- Vector-based rendering (crisp at any size)
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
- `references/community-examples.md` -- 170+ community templates organized by chart type, with author citations and direct links
- `references/vega-patterns.md` -- Vega chart patterns (bar, line, scatter, donut, stacked, heatmap, area, lollipop, bullet, KPI card), standard config, transforms and scales reference
- `references/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, interactivity example)
- `references/capabilities.md` -- Full Deneb object properties reference and template format (
usermetaschema) - `references/advanced-patterns.md` -- Advanced cross-filtering signals (Vega
pbiCrossFilterApply/pbiCrossFilterClear), performance engineering lever order, and community template round-trip from the terminal - `examples/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 escaping
- `examples/spec/vega-lite/` -- Standalone Vega-Lite spec files (bullet-chart, kpi-card) -- ready to inject after escaping
- `examples/standard-config.json` -- Standard config for all Deneb specs
Fetching Docs
To retrieve current Power BI custom visual docs, use microsoft_docs_search + microsoft_docs_fetch (MCP) if available, otherwise mslearn search + mslearn fetch (CLI). 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.
Related Skills
- `pbir-format` (pbip plugin) -- PBIR JSON format reference
- `pbi-report-design` -- Layout and design best practices
- `r-visuals` -- R Script visuals (ggplot2)
- `python-visuals` -- Python Script visuals (matplotlib)
- `svg-visuals` -- SVG via DAX measures (lightweight inline graphics)
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"name": "dataset"},
"transform": [
{"window": [{"op": "rank", "as": "rank"}], "sort": [{"field": "Value", "order": "descending"}]},
{"filter": "datum.rank <= 10"}
],
"facet": {
"row": {
"field": "Category",
"type": "nominal",
"sort": {"field": "Value", "order": "descending"},
"header": {
"labelAngle": 0,
"title": "",
"labelAlign": "left",
"labelPadding": 5
}
}
},
"spec": {
"layer": [
{
"mark": {"type": "bar", "color": "#d4dae0", "size": 10, "opacity": 1},
"encoding": {"x": {"field": "Value", "type": "quantitative"}}
},
{
"mark": {"type": "tick", "color": "black", "size": 25},
"encoding": {"x": {"field": "Target", "type": "quantitative"}}
},
{
"mark": {"type": "text", "align": "right", "dx": -5},
"encoding": {
"x": {"value": -15},
"text": {"field": "Value", "type": "quantitative", "format": ",.0f"},
"color": {"value": "#5d5d5d"}
}
},
{
"mark": {"type": "text", "align": "center", "dy": -20},
"encoding": {
"x": {"field": "Target", "type": "quantitative"},
"text": {"field": "Target", "type": "quantitative", "format": ",.0f"},
"color": {"value": "#5d5d5d"},
"size": {"value": 9}
}
}
]
}
}
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"name": "dataset"},
"transform": [
{"calculate": "datum['Value']", "as": "value"},
{"calculate": "datum['Target']", "as": "target"},
{"calculate": "(datum.value - datum.target) / datum.target", "as": "change"}
],
"layer": [
{
"mark": {"type": "text", "fontSize": 48, "fontWeight": "bold", "align": "center"},
"encoding": {
"text": {"field": "value", "type": "quantitative", "format": ",.0f"},
"color": {
"condition": {"test": "datum.change >= 0", "value": "#118DFF"},
"value": "#E66C37"
},
"y": {"value": 90}
}
},
{
"mark": {"type": "text", "fontSize": 14, "align": "center"},
"encoding": {
"text": {"value": "Value vs Target"},
"color": {"value": "#666666"},
"y": {"value": 30}
}
},
{
"mark": {"type": "text", "fontSize": 16, "align": "center"},
"encoding": {
"text": {"field": "change", "type": "quantitative", "format": "+.1%"},
"color": {
"condition": {"test": "datum.change >= 0", "value": "#118DFF"},
"value": "#E66C37"
},
"y": {"value": 140}
}
}
]
}
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"data": [{"name": "dataset"}],
"padding": 5,
"width": {"signal": "pbiContainerWidth - 25"},
"height": {"signal": "pbiContainerHeight - 27"},
"scales": [
{
"name": "xscale",
"type": "band",
"domain": {"data": "dataset", "field": "Category"},
"range": "width",
"padding": 0.1,
"round": true
},
{
"name": "yscale",
"type": "linear",
"domain": {"data": "dataset", "field": "Sales"},
"range": "height",
"nice": true,
"zero": true
}
],
"axes": [
{"orient": "bottom", "scale": "xscale"},
{"orient": "left", "scale": "yscale"}
],
"marks": [
{
"type": "rect",
"from": {"data": "dataset"},
"encode": {
"enter": {
"x": {"scale": "xscale", "field": "Category"},
"width": {"scale": "xscale", "band": 1},
"y": {"scale": "yscale", "field": "Sales"},
"y2": {"scale": "yscale", "value": 0},
"cornerRadiusTopLeft": {"value": 4},
"cornerRadiusTopRight": {"value": 4}
},
"update": {
"fill": {"signal": "pbiColor(0)"}
},
"hover": {
"fill": {"signal": "pbiColor(0, -0.3)"}
}
}
}
]
}
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"data": [{"name": "dataset"}],
"padding": 5,
"width": {"signal": "pbiContainerWidth - 25"},
"height": {"signal": "pbiContainerHeight - 27"},
"scales": [
{
"name": "x",
"type": "point",
"domain": {"data": "dataset", "field": "Date"},
"range": "width"
},
{
"name": "y",
"type": "linear",
"domain": {"data": "dataset", "field": "Value"},
"range": "height",
"nice": true,
"zero": true
},
{
"name": "color",
"type": "ordinal",
"domain": {"data": "dataset", "field": "Series"},
"range": {"scheme": "pbiColorNominal"}
}
],
"axes": [
{"orient": "bottom", "scale": "x"},
{"orient": "left", "scale": "y"}
],
"legends": [
{"stroke": "color", "orient": "top", "direction": "horizontal"}
],
"marks": [
{
"type": "group",
"from": {
"facet": {
"name": "series",
"data": "dataset",
"groupby": "Series"
}
},
"marks": [
{
"type": "line",
"from": {"data": "series"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "Date"},
"y": {"scale": "y", "field": "Value"},
"stroke": {"scale": "color", "field": "Series"},
"strokeWidth": {"value": 2}
},
"update": {
"interpolate": {"value": "monotone"},
"strokeOpacity": {"value": 1}
},
"hover": {
"strokeOpacity": {"value": 0.5}
}
}
}
]
}
]
}
{
"autosize": {"type": "fit", "contains": "padding"},
"view": {"stroke": "transparent"},
"font": "Segoe UI",
"axis": {
"ticks": false,
"grid": false,
"domain": false,
"labelFontSize": 11,
"titleFontSize": 12
},
"axisQuantitative": {
"tickCount": 5,
"grid": true,
"gridColor": "#E8E8E8",
"gridDash": [2, 4]
},
"legend": {
"orient": "top",
"labelFontSize": 11
},
"title": {
"fontSize": 14,
"font": "Segoe UI Semibold",
"anchor": "start"
}
}
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.6.0/schema.json",
"name": "1e3f7b60a16627ca3316",
"position": {
"x": 416,
"y": 144,
"z": 0,
"height": 432,
"width": 463.99999999999994,
"tabOrder": 0
},
"visual": {
"visualType": "deneb7E15AEF80B9E4D4F8E12924291ECE89A",
"query": {
"queryState": {
"dataset": {
"projections": [
{
"field": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Product"
}
},
"Property": "Category"
}
},
"queryRef": "Product.Category",
"nativeQueryRef": "Category"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Sales"
}
},
"Property": "Sales Amount"
}
},
"queryRef": "Sales.Sales Amount",
"nativeQueryRef": "Sales Amount"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Sales"
}
},
"Property": "Sales Amount (PY)"
}
},
"queryRef": "Sales.Sales Amount (PY)",
"nativeQueryRef": "Sales Amount (PY)"
}
]
}
}
},
"objects": {
"stateManagement": [
{
"properties": {
"viewportHeight": {
"expr": {
"Literal": {
"Value": "422D"
}
}
},
"viewportWidth": {
"expr": {
"Literal": {
"Value": "453.99999999999994D"
}
}
}
}
}
],
"vega": [
{
"properties": {
"provider": {
"expr": {
"Literal": {
"Value": "'vegaLite'"
}
}
},
"jsonSpec": {
"expr": {
"Literal": {
"Value": "'{\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\",\n \"data\": {\n \"name\": \"dataset\" // Power BI Data\n },\n \"facet\": {\n // Y-axis categories\n \"row\": {\n \"field\": \"Category\",\n \"type\": \"nominal\",\n \"sort\": {\n \"field\": \"Sales Amount\",\n \"order\": \"descending\"\n },\n\n // Might move to config?\n \"header\": {\n \"labelAngle\": 0,\n \"title\": \"\",\n \"labelAlign\": \"left\",\n \"labelPadding\": 5\n }\n }\n },\n \"spec\": {\n \"layer\": [\n {\n // Bars to show the actual\n \"mark\": {\"type\": \"bar\", \"color\": \"#d4dae0\", \"size\": 10, \"opacity\": 1},\n \"encoding\": {\n \"x\": {\"field\": \"Sales Amount\", \"type\": \"quantitative\"}\n }\n },\n {\n // Ticks to show the target\n \"mark\": {\"type\": \"tick\", \"color\": \"black\", \"size\": 25},\n \"encoding\": {\n \"x\": {\"field\": \"Sales Amount (PY)\", \"type\": \"quantitative\"}\n }\n },\n {\n // Circles to indicate action dots\n \"mark\": {\"type\": \"circle\"},\n \"encoding\": {\n \"x\": {\"value\": -10},\n \"color\": {\n \"condition\": [\n {\n // Very bad\n \"test\": \"datum[''Sales Amount''] < 0.50 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#f08c00\"\n },\n {\n // Bad\n \"test\": \"datum[''Sales Amount''] < 0.75 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#ffd43b\"\n },\n {\n // Very good\n \"test\": \"datum[''Sales Amount''] > 1.50 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#0074ba\"\n },\n {\n // Good\n \"test\": \"datum[''Sales Amount''] > 1.25 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#4dabf7\"\n }\n ],\n \"value\": null // No dot if within 96%-105%\n },\n \"size\": {\n \"condition\": [\n {\n // Very bad\n \"test\": \"datum[''Sales Amount''] < 0.50 * datum[''Sales Amount (PY)'']\",\n \"value\": 125\n },\n {\n // Bad\n \"test\": \"datum[''Sales Amount''] < 0.75 * datum[''Sales Amount (PY)'']\",\n \"value\": 75\n },\n {\n // Very good\n \"test\": \"datum[''Sales Amount''] > 1.50 * datum[''Sales Amount (PY)'']\",\n \"value\": 125\n },\n {\n // Good\n \"test\": \"datum[''Sales Amount''] > 1.25 * datum[''Sales Amount (PY)'']\",\n \"value\": 75\n }\n ],\n \"value\": 0 // No dot if within 96%-105%\n }\n }\n },\n {\n // Actuals label (between dot and bar)\n \"mark\": {\"type\": \"text\", \"align\": \"right\", \"dx\": -5},\n \"encoding\": {\n \"x\": {\"value\": -15},\n \"text\": {\"field\": \"Sales Amount\", \"type\": \"quantitative\", \"format\": \",.3s\"},\n \"color\": {\n \"condition\": [\n {\n // Very bad\n \"test\": \"datum[''Sales Amount''] < 0.50 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#f08c00\"\n },\n {\n // Bad\n \"test\": \"datum[''Sales Amount''] < 0.75 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#ccb35d\"\n },\n {\n // Very good\n \"test\": \"datum[''Sales Amount''] > 1.50 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#0074ba\"\n },\n {\n // Good\n \"test\": \"datum[''Sales Amount''] > 1.25 * datum[''Sales Amount (PY)'']\",\n \"value\": \"#4dabf7\"\n }\n ],\n \"value\": \"#5d5d5d\" // No dot if within 96%-105%\n }\n }\n },\n {\n // Target label (on top of tick)\n \"mark\": {\"type\": \"text\", \"align\": \"center\", \"dy\": -20},\n \"encoding\": {\n \"x\": {\"field\": \"Sales Amount (PY)\", \"type\": \"quantitative\"},\n \"text\": {\"field\": \"Sales Amount (PY)\", \"type\": \"quantitative\", \"format\": \",.3s\"},\n \"color\": {\"value\": \"#5d5d5d\"},\n \"size\": {\"value\": 9}\n }\n }\n ]\n }\n}'"
}
}
},
"jsonConfig": {
"expr": {
"Literal": {
"Value": "'{\r\n \"autosize\": {\r\n \"type\": \"fit\",\r\n \"contains\": \"padding\"\r\n },\r\n \"view\": {\"stroke\": \"transparent\"},\r\n \"font\": \"Segoe UI\",\r\n \"arc\": {},\r\n \"area\": {\r\n \"line\": true,\r\n \"opacity\": 0.6\r\n },\r\n \"bar\": {},\r\n \"line\": {\r\n \"strokeWidth\": 2,\r\n \"strokeCap\": \"round\",\r\n \"strokeJoin\": \"round\"\r\n },\r\n \"path\": {},\r\n \"point\": {\r\n \"filled\": true,\r\n \"size\": 75\r\n },\r\n \"rect\": {},\r\n \"shape\": {},\r\n \"symbol\": {},\r\n \"text\": {\r\n \"font\": \"Segoe UI Light\",\r\n \"fontSize\": 12,\r\n \"fill\": \"#AAAAAA\"\r\n },\r\n \"axis\": {\r\n \"ticks\": false,\r\n \"grid\": false,\r\n \"domain\": false,\r\n \"labelColor\": \"#AAAAAA\",\r\n \"labelFontSize\": 12,\r\n \"titleFont\": \"Segoe UI Light\",\r\n \"titleColor\": \"#AAAAAA\",\r\n \"titleFontSize\": 10\r\n },\r\n \"axisQuantitative\": {\r\n \"tickCount\": 5,\r\n \"grid\": true,\r\n \"gridColor\": \"#CCCCCC\",\r\n \"gridDash\": [1, 3],\r\n \"labelFlush\": false\r\n },\r\n \"axisX\": {\"labelPadding\": 2.5},\r\n \"header\": {\r\n \"labelFont\": \"Segoe UI Semibold\",\r\n \"labelFontSize\": 12,\r\n \"labelColor\": \"#5D5D5D\"\r\n },\r\n \"tick\": {\"thickness\": 1.5},\r\n \"facet\": {\r\n \"spacing\": 7.5 // Spacing between categories\r\n }\r\n }'"
}
}
},
"isNewDialogOpen": {
"expr": {
"Literal": {
"Value": "false"
}
}
},
"enableTooltips": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableContextMenu": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableHighlight": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableSelection": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"selectionMaxDataPoints": {
"expr": {
"Literal": {
"Value": "50D"
}
}
},
"logLevel": {
"expr": {
"Literal": {
"Value": "3D"
}
}
},
"version": {
"expr": {
"Literal": {
"Value": "'5.20.1'"
}
}
}
}
}
],
"editor": [
{
"properties": {
"previewScrollbars": {
"expr": {
"Literal": {
"Value": "false"
}
}
},
"fontSize": {
"expr": {
"Literal": {
"Value": "8D"
}
}
},
"wordWrap": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"theme": {
"expr": {
"Literal": {
"Value": "'light'"
}
}
}
}
}
],
"developer": [
{
"properties": {
"version": {
"expr": {
"Literal": {
"Value": "'1.7.1.0'"
}
}
}
}
}
]
},
"drillFilterOtherVisuals": true
}
}{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.2.0/schema.json",
"name": "kpi_order_lines_vs_py",
"position": {
"x": 40,
"y": 40,
"z": 0,
"height": 180,
"width": 560
},
"visual": {
"visualType": "deneb7E15AEF80B9E4D4F8E12924291ECE89A",
"query": {
"queryState": {
"dataset": {
"projections": [
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Orders"
}
},
"Property": "Order Lines"
}
},
"queryRef": "Orders.Order Lines",
"nativeQueryRef": "Order Lines"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Schema": "extension",
"Entity": "Orders"
}
},
"Property": "Order Lines (PY)"
}
},
"queryRef": "Orders.Order Lines (PY)",
"nativeQueryRef": "Order Lines (PY)"
}
]
}
}
},
"objects": {
"vega": [
{
"properties": {
"provider": {
"expr": {
"Literal": {
"Value": "'vegaLite'"
}
}
},
"jsonSpec": {
"expr": {
"Literal": {
"Value": "'{\"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\", \"data\": {\"name\": \"dataset\"}, \"transform\": [{\"calculate\": \"datum[''Order Lines'']\", \"as\": \"value\"}, {\"calculate\": \"datum[''Order Lines (PY)'']\", \"as\": \"target\"}, {\"calculate\": \"(datum.value - datum.target) / datum.target\", \"as\": \"change\"}], \"layer\": [{\"mark\": {\"type\": \"text\", \"fontSize\": 48, \"fontWeight\": \"bold\", \"align\": \"center\"}, \"encoding\": {\"text\": {\"field\": \"value\", \"type\": \"quantitative\", \"format\": \",.0f\"}, \"color\": {\"condition\": {\"test\": \"datum.change >= 0\", \"value\": \"#118DFF\"}, \"value\": \"#E66C37\"}, \"y\": {\"value\": 90}}}, {\"mark\": {\"type\": \"text\", \"fontSize\": 14, \"align\": \"center\"}, \"encoding\": {\"text\": {\"value\": \"Order Lines vs PY\"}, \"color\": {\"value\": \"#666666\"}, \"y\": {\"value\": 30}}}, {\"mark\": {\"type\": \"text\", \"fontSize\": 16, \"align\": \"center\"}, \"encoding\": {\"text\": {\"field\": \"change\", \"type\": \"quantitative\", \"format\": \"+.1%\"}, \"color\": {\"condition\": {\"test\": \"datum.change >= 0\", \"value\": \"#118DFF\"}, \"value\": \"#E66C37\"}, \"y\": {\"value\": 140}}}]}'"
}
}
},
"enableTooltips": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"jsonConfig": {
"expr": {
"Literal": {
"Value": "'{\"autosize\":{\"type\":\"fit\",\"contains\":\"padding\"},\"view\":{\"stroke\":\"transparent\"},\"font\":\"Segoe UI\"}'"
}
}
},
"isNewDialogOpen": {
"expr": {
"Literal": {
"Value": "false"
}
}
},
"enableContextMenu": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableHighlight": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableSelection": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"selectionMaxDataPoints": {
"expr": {
"Literal": {
"Value": "50D"
}
}
},
"logLevel": {
"expr": {
"Literal": {
"Value": "3D"
}
}
},
"version": {
"expr": {
"Literal": {
"Value": "'5.20.1'"
}
}
}
}
}
],
"stateManagement": [
{
"properties": {
"viewportHeight": {
"expr": {
"Literal": {
"Value": "170D"
}
}
},
"viewportWidth": {
"expr": {
"Literal": {
"Value": "550D"
}
}
}
}
}
],
"editor": [
{
"properties": {
"fontSize": {
"expr": {
"Literal": {
"Value": "8D"
}
}
},
"wordWrap": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"theme": {
"expr": {
"Literal": {
"Value": "'light'"
}
}
}
}
}
],
"developer": [
{
"properties": {
"version": {
"expr": {
"Literal": {
"Value": "'1.7.1.0'"
}
}
}
}
}
]
}
}
}{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.2.0/schema.json",
"name": "trend_order_lines",
"position": {
"x": 40,
"y": 260,
"z": 3,
"height": 320,
"width": 1760
},
"visual": {
"visualType": "deneb7E15AEF80B9E4D4F8E12924291ECE89A",
"query": {
"queryState": {
"dataset": {
"projections": [
{
"field": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Date"
}
},
"Property": "Date"
}
},
"queryRef": "Date.Date",
"nativeQueryRef": "Date"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Orders"
}
},
"Property": "Order Lines"
}
},
"queryRef": "Orders.Order Lines",
"nativeQueryRef": "Order Lines"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Schema": "extension",
"Entity": "Orders"
}
},
"Property": "Order Lines (PY)"
}
},
"queryRef": "Orders.Order Lines (PY)",
"nativeQueryRef": "Order Lines (PY)"
}
]
}
}
},
"objects": {
"vega": [
{
"properties": {
"provider": {
"expr": {
"Literal": {
"Value": "'vegaLite'"
}
}
},
"jsonSpec": {
"expr": {
"Literal": {
"Value": "'{\"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\", \"data\": {\"name\": \"dataset\"}, \"transform\": [{\"fold\": [\"Order Lines\", \"Order Lines (PY)\"], \"as\": [\"Measure\", \"Value\"]}], \"mark\": {\"type\": \"line\", \"strokeWidth\": 2, \"point\": false}, \"encoding\": {\"x\": {\"field\": \"Date\", \"type\": \"temporal\", \"axis\": {\"title\": null, \"grid\": false, \"labelAngle\": 0}}, \"y\": {\"field\": \"Value\", \"type\": \"quantitative\", \"axis\": {\"title\": null, \"grid\": true, \"gridColor\": \"#e0e0e0\", \"gridDash\": [2, 2]}, \"scale\": {\"zero\": false}}, \"color\": {\"field\": \"Measure\", \"type\": \"nominal\", \"scale\": {\"domain\": [\"Order Lines\", \"Order Lines (PY)\"], \"range\": [\"#118DFF\", \"#999999\"]}, \"legend\": {\"title\": null, \"orient\": \"top\", \"direction\": \"horizontal\"}}}}'"
}
}
},
"enableTooltips": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"jsonConfig": {
"expr": {
"Literal": {
"Value": "'{\"autosize\":{\"type\":\"fit\",\"contains\":\"padding\"},\"view\":{\"stroke\":\"transparent\"},\"font\":\"Segoe UI\"}'"
}
}
},
"isNewDialogOpen": {
"expr": {
"Literal": {
"Value": "false"
}
}
},
"enableContextMenu": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableHighlight": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableSelection": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"selectionMaxDataPoints": {
"expr": {
"Literal": {
"Value": "50D"
}
}
},
"logLevel": {
"expr": {
"Literal": {
"Value": "3D"
}
}
},
"version": {
"expr": {
"Literal": {
"Value": "'5.20.1'"
}
}
}
}
}
],
"stateManagement": [
{
"properties": {
"viewportHeight": {
"expr": {
"Literal": {
"Value": "310D"
}
}
},
"viewportWidth": {
"expr": {
"Literal": {
"Value": "1750D"
}
}
}
}
}
],
"editor": [
{
"properties": {
"fontSize": {
"expr": {
"Literal": {
"Value": "8D"
}
}
},
"wordWrap": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"theme": {
"expr": {
"Literal": {
"Value": "'light'"
}
}
}
}
}
],
"developer": [
{
"properties": {
"version": {
"expr": {
"Literal": {
"Value": "'1.7.1.0'"
}
}
}
}
}
]
}
}
}{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.2.0/schema.json",
"name": "deneb_comparison",
"position": {
"x": 648,
"y": 407,
"z": 1000,
"height": 290,
"width": 608,
"tabOrder": 4
},
"visual": {
"visualType": "deneb7E15AEF80B9E4D4F8E12924291ECE89A",
"query": {
"queryState": {
"dataset": {
"projections": [
{
"field": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Date"
}
},
"Property": "Calendar Month (ie Jan)"
}
},
"queryRef": "Date.Calendar Month (ie Jan)",
"nativeQueryRef": "Calendar Month (ie Jan)",
"active": true
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Measure Selection"
}
},
"Property": "Actuals YTD"
}
},
"queryRef": "Measure Selection.Actuals YTD",
"nativeQueryRef": "Actuals YTD",
"active": true
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Entity": "Measure Selection"
}
},
"Property": "Sales Target YTD"
}
},
"queryRef": "Measure Selection.Sales Target YTD",
"nativeQueryRef": "Sales Target YTD",
"active": true
}
]
}
}
},
"objects": {
"vega": [
{
"properties": {
"provider": {
"expr": {
"Literal": {
"Value": "'vegaLite'"
}
}
},
"jsonSpec": {
"expr": {
"Literal": {
"Value": "'{\"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\", \"data\": {\"name\": \"dataset\"}, \"transform\": [{\"calculate\": \"indexof(['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], datum['Calendar Month (ie Jan)'])\", \"as\": \"month_order\"}, {\"calculate\": \"datum['Actuals YTD']\", \"as\": \"Actuals\"}, {\"calculate\": \"datum['Sales Target YTD']\", \"as\": \"Target\"}, {\"calculate\": \"datum.Actuals >= 1e9 ? format(datum.Actuals / 1e9, '.2f') + 'bn' : datum.Actuals >= 1e6 ? format(datum.Actuals / 1e6, '.1f') + 'M' : format(datum.Actuals / 1e3, '.0f') + 'K'\", \"as\": \"ActualsLabel\"}, {\"calculate\": \"datum.Target >= 1e9 ? format(datum.Target / 1e9, '.2f') + 'bn' : datum.Target >= 1e6 ? format(datum.Target / 1e6, '.1f') + 'M' : format(datum.Target / 1e3, '.0f') + 'K'\", \"as\": \"TargetLabel\"}, {\"window\": [{\"op\": \"rank\", \"as\": \"rank\"}], \"sort\": [{\"field\": \"month_order\", \"order\": \"descending\"}]}, {\"fold\": [\"Actuals\", \"Target\"], \"as\": [\"Series\", \"Value\"]}], \"encoding\": {\"x\": {\"field\": \"Calendar Month (ie Jan)\", \"type\": \"ordinal\", \"scale\": {\"domain\": [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]}, \"axis\": {\"title\": null, \"labelAngle\": 0, \"labelFontSize\": 11}}}, \"layer\": [{\"mark\": {\"type\": \"line\", \"strokeWidth\": 3}, \"encoding\": {\"y\": {\"field\": \"Value\", \"type\": \"quantitative\", \"axis\": {\"title\": null, \"labelFontSize\": 11, \"labelExpr\": \"datum.value >= 1e9 ? format(datum.value / 1e9, '.0f') + 'bn' : datum.value >= 1e6 ? format(datum.value / 1e6, '.0f') + 'M' : format(datum.value / 1e3, '.0f') + 'K'\"}}, \"color\": {\"field\": \"Series\", \"type\": \"nominal\", \"scale\": {\"domain\": [\"Actuals\", \"Target\"], \"range\": [\"#118DFF\", \"#888888\"]}, \"legend\": {\"title\": null, \"labelFontSize\": 11, \"orient\": \"top-left\"}}, \"strokeDash\": {\"field\": \"Series\", \"type\": \"nominal\", \"scale\": {\"domain\": [\"Actuals\", \"Target\"], \"range\": [[], [4, 4]]}, \"legend\": null}, \"strokeWidth\": {\"field\": \"Series\", \"type\": \"nominal\", \"scale\": {\"domain\": [\"Actuals\", \"Target\"], \"range\": [3, 1.5]}, \"legend\": null}}}, {\"transform\": [{\"filter\": \"datum.rank == 1 && datum.Series == 'Actuals'\"}], \"mark\": {\"type\": \"point\", \"filled\": true, \"size\": 80, \"stroke\": \"#118DFF\", \"strokeWidth\": 2, \"fill\": \"white\"}, \"encoding\": {\"y\": {\"field\": \"Value\", \"type\": \"quantitative\"}}}, {\"transform\": [{\"filter\": \"datum.rank == 1 && datum.Series == 'Target'\"}], \"mark\": {\"type\": \"point\", \"filled\": true, \"size\": 50, \"stroke\": \"#888888\", \"strokeWidth\": 1.5, \"fill\": \"white\"}, \"encoding\": {\"y\": {\"field\": \"Value\", \"type\": \"quantitative\"}}}, {\"transform\": [{\"filter\": \"datum.rank == 1 && datum.Series == 'Actuals'\"}], \"mark\": {\"type\": \"text\", \"align\": \"left\", \"dx\": 8, \"dy\": -8, \"fontWeight\": \"bold\", \"color\": \"#118DFF\", \"fontSize\": 12}, \"encoding\": {\"y\": {\"field\": \"Value\", \"type\": \"quantitative\"}, \"text\": {\"field\": \"ActualsLabel\", \"type\": \"nominal\"}}}, {\"transform\": [{\"filter\": \"datum.rank == 1 && datum.Series == 'Target'\"}], \"mark\": {\"type\": \"text\", \"align\": \"left\", \"dx\": 8, \"dy\": 12, \"color\": \"#888888\", \"fontSize\": 12}, \"encoding\": {\"y\": {\"field\": \"Value\", \"type\": \"quantitative\"}, \"text\": {\"field\": \"TargetLabel\", \"type\": \"nominal\"}}}], \"config\": {\"view\": {\"stroke\": null}, \"axis\": {\"labelColor\": \"#6C757D\", \"tickColor\": \"#DEE2E6\", \"domainColor\": \"#DEE2E6\"}}}'"
}
}
},
"jsonConfig": {
"expr": {
"Literal": {
"Value": "'{\"autosize\": {\"type\": \"fit\", \"contains\": \"padding\"}, \"view\": {\"stroke\": \"transparent\"}, \"font\": \"Segoe UI\", \"axis\": {\"ticks\": false, \"grid\": false, \"domain\": false, \"labelColor\": \"#6C757D\", \"labelFontSize\": 11}, \"axisQuantitative\": {\"tickCount\": 5, \"grid\": true, \"gridColor\": \"#DEE2E6\", \"gridDash\": [2, 4]}, \"legend\": {\"labelFontSize\": 11, \"titleFontSize\": 11}}'"
}
}
},
"enableTooltips": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableSelection": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableHighlight": {
"expr": {
"Literal": {
"Value": "true"
}
}
}
}
}
]
},
"drillFilterOtherVisuals": true,
"visualContainerObjects": {
"title": [
{
"properties": {
"show": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"text": {
"expr": {
"Literal": {
"Value": "'Turnover YTD vs 1YP'"
}
}
}
}
}
],
"subTitle": [
{
"properties": {
"show": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"text": {
"expr": {
"Literal": {
"Value": "'Deneb'"
}
}
}
}
}
]
}
}
}{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
"name": "3d4e5f6a7b8c9d0e",
"position": {
"x": 860,
"y": 80,
"z": 4,
"height": 635,
"width": 400,
"tabOrder": 4
},
"visual": {
"visualType": "deneb7E15AEF80B9E4D4F8E12924291ECE89A",
"query": {
"queryState": {
"dataset": {
"projections": [
{
"field": {
"Column": {
"Expression": {
"SourceRef": {
"Entity": "Date"
}
},
"Property": "Calendar Month (ie Jan)"
}
},
"queryRef": "Date.Calendar Month (ie Jan)",
"nativeQueryRef": "Calendar Month (ie Jan)"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Schema": "extension",
"Entity": "Orders"
}
},
"Property": "Order Lines YTD"
}
},
"queryRef": "Orders.Order Lines YTD",
"nativeQueryRef": "Order Lines YTD"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": {
"Schema": "extension",
"Entity": "Orders"
}
},
"Property": "Order Lines (PY) YTD"
}
},
"queryRef": "Orders.Order Lines (PY) YTD",
"nativeQueryRef": "Order Lines (PY) YTD"
}
]
}
}
},
"objects": {
"vega": [
{
"properties": {
"provider": {
"expr": {
"Literal": {
"Value": "'vegaLite'"
}
}
},
"jsonSpec": {
"expr": {
"Literal": {
"Value": "'{\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.json\",\n \"data\": {\n \"name\": \"dataset\"\n },\n \"transform\": [\n {\n \"fold\": [\n \"Order Lines YTD\",\n \"Order Lines (PY) YTD\"\n ],\n \"as\": [\n \"Measure\",\n \"Value\"\n ]\n },\n {\n \"window\": [\n {\n \"op\": \"row_number\",\n \"as\": \"row\"\n }\n ],\n \"groupby\": [\n \"Measure\"\n ]\n },\n {\n \"calculate\": \"datum.row === 12 ? datum.Value : null\",\n \"as\": \"LastValue\"\n }\n ],\n \"layer\": [\n {\n \"mark\": {\n \"type\": \"line\",\n \"strokeWidth\": 3.5,\n \"point\": false\n },\n \"encoding\": {\n \"x\": {\n \"field\": \"Calendar Month (ie Jan)\",\n \"type\": \"nominal\",\n \"axis\": {\n \"title\": null,\n \"grid\": false,\n \"labelAngle\": -45\n },\n \"sort\": [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ]\n },\n \"y\": {\n \"field\": \"Value\",\n \"type\": \"quantitative\",\n \"axis\": {\n \"title\": null,\n \"grid\": false,\n \"labelColor\": \"#6C757D\",\n \"labelFontSize\": 12,\n \"format\": \",.3s\"\n },\n \"scale\": {\n \"zero\": true\n }\n },\n \"color\": {\n \"field\": \"Measure\",\n \"type\": \"nominal\",\n \"scale\": {\n \"domain\": [\n \"Order Lines YTD\",\n \"Order Lines (PY) YTD\"\n ],\n \"range\": [\n \"#5B8DBE\",\n \"#D4A574\"\n ]\n },\n \"legend\": null\n },\n \"strokeDash\": {\n \"field\": \"Measure\",\n \"type\": \"nominal\",\n \"scale\": {\n \"domain\": [\n \"Order Lines YTD\",\n \"Order Lines (PY) YTD\"\n ],\n \"range\": [\n [\n 1,\n 0\n ],\n [\n 5,\n 5\n ]\n ]\n },\n \"legend\": null\n }\n }\n },\n {\n \"mark\": {\n \"type\": \"point\",\n \"filled\": true,\n \"size\": 100,\n \"stroke\": \"white\",\n \"strokeWidth\": 2\n },\n \"encoding\": {\n \"x\": {\n \"field\": \"Calendar Month (ie Jan)\",\n \"type\": \"nominal\",\n \"sort\": [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ]\n },\n \"y\": {\n \"field\": \"LastValue\",\n \"type\": \"quantitative\"\n },\n \"color\": {\n \"field\": \"Measure\",\n \"type\": \"nominal\",\n \"scale\": {\n \"domain\": [\n \"Order Lines YTD\",\n \"Order Lines (PY) YTD\"\n ],\n \"range\": [\n \"#5B8DBE\",\n \"#D4A574\"\n ]\n },\n \"legend\": null\n }\n }\n },\n {\n \"mark\": {\n \"type\": \"text\",\n \"align\": \"left\",\n \"dx\": 5,\n \"dy\": -10,\n \"fontSize\": 18,\n \"fontWeight\": 600\n },\n \"encoding\": {\n \"x\": {\n \"field\": \"Calendar Month (ie Jan)\",\n \"type\": \"nominal\",\n \"sort\": [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\"\n ]\n },\n \"y\": {\n \"field\": \"LastValue\",\n \"type\": \"quantitative\"\n },\n \"text\": {\n \"field\": \"LastValue\",\n \"type\": \"quantitative\",\n \"format\": \",.3s\"\n },\n \"color\": {\n \"field\": \"Measure\",\n \"type\": \"nominal\",\n \"scale\": {\n \"domain\": [\n \"Order Lines YTD\",\n \"Order Lines (PY) YTD\"\n ],\n \"range\": [\n \"#5B8DBE\",\n \"#D4A574\"\n ]\n },\n \"legend\": null\n }\n }\n }\n ]\n}'"
}
}
},
"enableTooltips": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"jsonConfig": {
"expr": {
"Literal": {
"Value": "'{\"autosize\":{\"type\":\"fit\",\"contains\":\"padding\"},\"view\":{\"stroke\":\"transparent\"},\"font\":\"Segoe UI\"}'"
}
}
},
"enableContextMenu": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"enableSelection": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"version": {
"expr": {
"Literal": {
"Value": "'6.4.1'"
}
}
},
"isNewDialogOpen": {
"expr": {
"Literal": {
"Value": "false"
}
}
}
}
}
],
"stateManagement": [
{
"properties": {
"viewportHeight": {
"expr": {
"Literal": {
"Value": "580D"
}
}
},
"viewportWidth": {
"expr": {
"Literal": {
"Value": "378D"
}
}
}
}
}
],
"developer": [
{
"properties": {
"version": {
"expr": {
"Literal": {
"Value": "'1.8.2.0'"
}
}
}
}
}
]
},
"visualContainerObjects": {
"title": [
{
"properties": {
"show": {
"expr": {
"Literal": {
"Value": "true"
}
}
},
"text": {
"expr": {
"Literal": {
"Value": "'Deneb (Vega-Lite)'"
}
}
}
}
}
],
"subTitle": [
{
"properties": {
"show": {
"expr": {
"Literal": {
"Value": "false"
}
}
}
}
}
]
},
"drillFilterOtherVisuals": true
}
}
Advanced Deneb Patterns
Advanced Cross-Filtering (Vega only)
Simple selection mode (selectionMode: simple) auto-resolves __selected__ per mark. Advanced mode is required for brush-select, lasso, region-click, or any selection that is not one-mark = one-row. It is Vega only; Vega-Lite cannot use it, so plan the provider from the start.
Two signal functions exposed in advanced mode:
pbiCrossFilterApply(event, filter?, options?)-- filter the original dataset by the optional predicate and cross-filter on the result;eventis required as the first argpbiCrossFilterClear()-- clear, no args
Basic point-click pattern:
"signals": [{
"name": "pbiCrossFilterSelection",
"value": [],
"on": [
{
"events": {"source": "scope", "type": "mouseup", "markname": "data-point"},
"update": "pbiCrossFilterApply(event)"
},
{
"events": {
"source": "view", "type": "mouseup",
"filter": ["!event.item || event.item.mark.name != 'data-point'"]
},
"update": "pbiCrossFilterClear()"
}
]
}]For a brush, bind a Vega interval selection and pass its extent into the filter argument. The options.limit key (1-2500, default 50) overrides the simple-mode 250 cap because you control row resolution.
Enable via:
pbir set "<path>" objects.vega[0].properties.selectionMode '"advanced"'Pitfalls:
- Switching a working simple-mode visual to advanced silently kills cross-filtering until the signals are authored
- After aggregated marks the resolved data is at a different granularity than the base
dataset; aliased columns must match original names or rows resolve empty - A community-reported failure pattern: the visual filters others but never reflects an external filter back into
__selected__; flag in review, it is a known Deneb limitation in some versions
Performance Engineering
A Deneb visual re-runs the whole Vega dataflow on every interaction. Cost scales row count x mark count x per-row field count, and Power BI widens every row with runtime fields. Apply levers cheapest-first:
1. Aggregate in DAX, not Vega -- bind a monthly measure so the model sends ~12 rows; a transform aggregate over 50K rows recomputes on every hover. Push grouping to the model or a visual-level Top N filter 2. Prefer `renderMode: canvas` for many marks -- SVG creates a DOM node per mark; canvas draws to a bitmap. Keep SVG only when marks are few or selectable text is needed 3. Trim marks before raising limits -- collapse decorative layers first 4. Drop unused runtime field bloat -- every bound measure ships <measure>__formatted and <measure>__format; bind only what the spec uses 5. `dataLimit.override` as a last resort -- paired with canvas; removes the soft 10K guard but the model's own row cap still applies and can truncate silently
pbir set "<path>" objects.vega[0].properties.renderMode '"canvas"'
pbir set "<path>" objects.dataLimit[0].properties.override trueKeep the cross-filter limit as low as the interaction allows (simple mode caps at 250 for this reason).
Pitfalls:
dataLimit.overridedoes not remove the model-side cap; verify the expected row count actually arrives- Canvas mode breaks SVG-dependent tooltips and makes text non-selectable; confirm tooltips still fire after switching
- A spec fine in Desktop can stall in a specific browser (Edge has had known rendering issues with large canvas specs); check the audience's browser
Template Round-Trip (Terminal Import)
The Deneb GUI prompts for placeholder mapping on import; from a terminal you substitute manually then inject. A template is a Vega/Vega-Lite spec whose field references are placeholders matching ^__[a-zA-Z0-9]+__$ (e.g. __category__), described in usermeta.dataset.
Steps:
1. Read usermeta.dataset for each key (placeholder), kind (column vs measure), type. Kind is load-bearing: wrong kind passes pbir validate but fails at runtime 2. Strip usermeta and $schema from the spec body (Deneb's object does not consume usermeta) 3. Replace each __placeholder__ token in the spec text with the real field name, applying PBIR escaping (doubled single quotes inside jsonSpec for names with spaces/apostrophes); do this before injection 4. Add the visual, inject the rewritten spec into jsonSpec, create the dataset role bindings:
pbir visuals bind "<path>" -r dataset -d "Sales.OrderDate" -t Column
pbir visuals bind "<path>" -r dataset -d "Sales.Total" -t Measure5. Set provider to match (vega / vegaLite); if the template shipped a config block, inject it into jsonConfig, not jsonSpec; validate
Pitfalls:
usermeta.deneb.providerVersioncan lag the installed Deneb build; the most common break is a leftoverdatum.__identity__(removed in Deneb 1.9); rewrite todatum.__row__- Leaving
usermetainjsonSpec, or leaving"data": {"values": [...]}sample rows, ships stale embedded data; the spec must read{"name": "dataset"} - External
data.urltemplates fail AppSource certification and break offline; replace with thedatasetbinding - A wrong-
kindbinding (column where measure expected) passes validate but renders blank
For the usermeta.dataset schema see references/capabilities.md.
Deneb Capabilities and Template Format
Visual Capabilities
Data Roles
Single data role -- all columns and measures go into one "Values" well:
{
"dataRoles": [{"displayName": "Values", "name": "dataset", "kind": "GroupingOrMeasure"}],
"dataViewMappings": [{
"categorical": {
"categories": {"select": [{"bind": {"to": "dataset"}}], "dataReductionAlgorithm": {"window": {"count": 10000}}},
"values": {"select": [{"bind": {"to": "dataset"}}]}
}
}]
}Supported Features
| Feature | Value |
|---|---|
| Landing page | Yes |
| Multi-visual selection | Yes |
| Empty data view | No |
| Cross-highlighting | Yes |
| Default title | Suppressed |
| Advanced edit mode | Level 2 |
| Enhanced tooltips | Yes (default + canvas) |
Object Properties Reference
vega object (core)
| Property | Type | Default | Description |
|---|---|---|---|
jsonSpec | text | -- | Vega/Vega-Lite specification JSON |
jsonConfig | text | -- | Vega/Vega-Lite config JSON |
provider | vegaLite / vega | vegaLite | Language provider |
version | text | -- | Provider version string |
logLevel | 0-4 | 3 | none/error/warn/info/debug |
renderMode | svg / canvas | svg | Rendering engine |
enableTooltips | bool | true | Power BI tooltips |
enableContextMenu | bool | true | Right-click context menu |
enableHighlight | bool | false | Cross-highlighting |
enableSelection | bool | false | Cross-filtering |
selectionMode | simple / advanced | simple | Selection management |
selectionMaxDataPoints | 1-250 | 50 | Max selectable points (UI slider cap; advanced mode supports up to 2500) |
tooltipDelay | numeric | -- | Tooltip display delay (ms) |
editor object
| Property | Type | Default | Description |
|---|---|---|---|
theme | dark / light | light | Editor color theme |
fontSize | fontSize | 8 | Editor font size |
wordWrap | bool | true | Enable word wrap |
showLineNumbers | bool | -- | Show line numbers |
position | left / right | -- | Editor pane position |
debouncePeriod | numeric | -- | Auto-apply debounce (ms) |
display object
| Property | Type | Description |
|---|---|---|
scrollbarColor | solid color | Scrollbar fill color |
scrollbarOpacity | integer | Scrollbar opacity |
scrollbarRadius | integer | Scrollbar border radius |
dataLimit object
| Property | Type | Description |
|---|---|---|
override | bool | Override default 10K row limit |
showCustomVisualNotes | bool | Show custom visual notes |
stateManagement object (auto-managed)
| Property | Type | Description |
|---|---|---|
viewportHeight | numeric | Current viewport height |
viewportWidth | numeric | Current viewport width |
developer object (internal)
| Property | Type | Description |
|---|---|---|
version | text | Deneb visual version |
locale | enum | Locale (en-US, en-GB, de-DE, fr-FR) |
Template Format (v1)
Templates are valid Vega/Vega-Lite JSON files with a usermeta object. Schema: https://deneb.guide/schema/deneb-template-usermeta-v1.json
Structure
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"usermeta": {
"deneb": {
"build": "1.9.0.0",
"metaVersion": 1,
"provider": "vegaLite",
"providerVersion": "6.4.1"
},
"information": {
"name": "Chart Name",
"description": "Description",
"author": "Author Name",
"uuid": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",
"generated": "2024-01-01T00:00:00.000Z"
},
"dataset": [
{"key": "__category__", "name": "Category", "kind": "column", "type": "text"},
{"key": "__measure__", "name": "Measure", "kind": "measure", "type": "numeric"}
],
"interactivity": {
"tooltip": true,
"contextMenu": true,
"selection": false,
"highlight": false,
"dataPointLimit": 50
}
},
"data": {"name": "dataset"},
"mark": "bar",
"encoding": {
"x": {"field": "__category__", "type": "nominal"},
"y": {"field": "__measure__", "type": "quantitative"}
}
}usermeta.deneb (required)
| Property | Type | Required | Description |
|---|---|---|---|
build | string | Yes | Semantic version of the Deneb visual |
metaVersion | number | Yes | Must be 1 |
provider | enum | Yes | "vega" or "vegaLite" |
providerVersion | string | Yes | Vega/Vega-Lite version |
usermeta.information (required)
| Property | Type | Required | Description |
|---|---|---|---|
name | string (max 100) | Yes | Template display name |
author | string (max 100) | Yes | Creator identifier |
description | string (max 300) | No | Detailed description |
uuid | UUID v4 | Yes | Unique template ID |
generated | date-time | Yes | UTC timestamp |
supportUri | URI | No | Documentation link |
previewImageBase64PNG | string | No | Base64 preview (max 150x150px) |
usermeta.dataset (required, array)
| Property | Type | Required | Description |
|---|---|---|---|
key | string ^__[a-zA-Z0-9]+__$ (max 30) | Yes | Placeholder key in spec |
name | string (max 30) | Yes | Display name |
kind | any / column / measure | Yes | Field type |
type | bool / dateTime / numeric / other / text | Yes | Data type |
description | string (max 300) | No | Usage description |
usermeta.interactivity (optional)
| Property | Type | Description |
|---|---|---|
tooltip | bool | Enable tooltips |
contextMenu | bool | Enable context menu |
selection | bool | Enable cross-filtering |
highlight | bool | Enable cross-highlighting |
dataPointLimit | 1-250 | Max selectable data points |
Special Fields
Deneb adds these fields to the dataset at runtime:
| Field | Purpose |
|---|---|
__row__ | Zero-based row index. Use for cross-filtering row context. Replaces __identity__ (removed in 1.9) |
__selected__ | Selection state: "on", "off", or "neutral" |
<field>__highlight | Cross-highlight value for each measure (the highlighted number) |
<field>__highlightStatus | Highlight state per measure: "on", "off", or "neutral" |
<field>__highlightComparator | Pre-computed comparison: "eq", "lt", "gt", "neq" (highlight vs original) |
<field>__formatted | Pre-formatted string value using the Power BI format string for that measure |
<field>__format | The Power BI format string for the measure (e.g. "$#,0.00") |
Breaking change in 1.9:__identity__and__key__were removed. Any spec usingdatum.__identity__must be updated todatum.__row__.
Community Resources
| Resource | URL |
|---|---|
| Deneb documentation | https://deneb.guide |
| Deneb GitHub | https://github.com/deneb-viz/deneb |
| Kerry Kolosko templates | https://kerrykolosko.com/portfolio/ |
| PBI-David/Deneb-Showcase | https://github.com/PBI-David/Deneb-Showcase |
| PBIQueryous/Deneb | https://github.com/PBIQueryous/Deneb |
| avatorl/Deneb-Vega-Templates | https://github.com/avatorl/Deneb-Vega-Templates |
| Vega-Lite docs | https://vega.github.io/vega-lite/ |
Deneb Community Examples
Organized by chart type. Retrieve specific examples when you need a pattern for a chart type.
Deneb Template Format
Community examples come in three formats. Understand these to fetch and adapt them correctly.
1. Deneb Template JSON (.deneb-template.json or .json)
The most common format in community repos. A valid Vega/Vega-Lite spec with a usermeta block bolted on for Deneb's import/export workflow:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"usermeta": {
"deneb": {
"build": "1.6.2.1",
"metaVersion": 1,
"provider": "vegaLite"
},
"information": {
"name": "Simple Bar Chart",
"description": "Basic bar chart.",
"author": "Daniel Marsh-Patrick",
"uuid": "65f4a0a0-...",
"generated": "2021-09-14T16:13:43.104Z"
},
"dataset": [
{
"key": "__0__",
"name": "Category",
"description": "Categorical field on Y-axis",
"type": "text",
"kind": "column"
},
{
"key": "__1__",
"name": "Value",
"description": "Numeric measure",
"type": "numeric",
"kind": "measure"
}
]
},
"config": { "autosize": { "type": "fit", "contains": "padding" } },
"data": { "name": "dataset" },
"mark": { "type": "bar", "tooltip": true },
"encoding": {
"y": { "field": "__0__", "type": "nominal" },
"x": { "field": "__1__", "type": "quantitative" }
}
}Key elements:
- `usermeta.deneb` -- build version, provider (
vegaorvegaLite) - `usermeta.dataset` -- field placeholder definitions.
key(e.g.__0__) maps to field references in the spec.kindiscolumnormeasure.typeistext,numeric,dateTime, orbool - `usermeta.information` -- metadata (name, author, description)
- The actual spec (mark, encoding, layer, etc.) sits at the top level using placeholder keys
How to use a template
To import into Deneb UI: Use Deneb's built-in "New visual" > "Import from template" dialog. It reads the usermeta.dataset to prompt for field mappings.
To inject into PBIR visual.json programmatically:
1. Strip usermeta from the JSON 2. Replace placeholder keys (__0__, __1__) with actual field display names from your model (matching nativeQueryRef) 3. Stringify the spec and wrap in single quotes for jsonSpec literal value (see escaping rules in SKILL.md Step 3) 4. Extract config separately for jsonConfig
For a full terminal workflow (CLI bind commands, kind validation, breaking changes, pitfalls) see references/advanced-patterns.md.
To create a new template from an existing spec:
1. Replace hardcoded field names with placeholder keys (__0__, __1__, etc.) 2. Add the usermeta block with deneb, information, and dataset sections 3. In dataset, define each placeholder with key, name, description, type, and kind 4. Keep "data": {"name": "dataset"} unchanged
2. Raw Spec JSON
A plain Vega or Vega-Lite spec without usermeta. Used by PBI-David/Deneb-Showcase (Spec.json files) and some standalone examples. Ready to inject directly after field name substitution.
3. Blog-embedded Spec
Vega/Vega-Lite JSON embedded in HTML blog posts (Thys van der Walt, Kerry Kolosko). Fetch the page and extract the spec from code blocks.
Template Repositories
How to Fetch
Each repo has a different file structure. Use these patterns to construct raw URLs:
| Repo | File Pattern | Raw URL Base | API to List |
|---|---|---|---|
| avatorl/Deneb-Vega-Templates | {category}/{slug}.deneb-template.json | https://raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/ | api.github.com/repos/avatorl/Deneb-Vega-Templates/contents/{category} |
| PowerBI-tips/Deneb-Templates | templates/{Title Case Name}.json | https://raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/ | api.github.com/repos/PowerBI-tips/Deneb-Templates/contents/templates |
| PBI-David/Deneb-Showcase | {Title Case Dir}/Spec.json | https://raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/ | api.github.com/repos/PBI-David/Deneb-Showcase/contents |
| clemviz/Deneb-Templates | {file}.json or {subdir}/{file}.json | https://raw.githubusercontent.com/clemviz/Deneb-Templates/main/ | api.github.com/repos/clemviz/Deneb-Templates/contents |
| shadfrigui/vega-lite | deneb-templates/{slug}/{slug}-deneb.json | https://raw.githubusercontent.com/shadfrigui/vega-lite/main/ | api.github.com/repos/shadfrigui/vega-lite/contents/deneb-templates |
| Giammaria/Vega-Visuals | {dir}/ (contains .vg.json) | https://raw.githubusercontent.com/Giammaria/Vega-Visuals/main/ | api.github.com/repos/Giammaria/Vega-Visuals/contents |
Repository Index
| Repository | Author | Provider | Format | Count |
|---|---|---|---|---|
| Deneb-Vega-Templates | Andrzej Leszkiewicz | Vega | Template JSON | 50+ |
| Deneb-Showcase | PBI-David | Vega | Raw spec (Spec.json) | 28 |
| Deneb-Templates | PowerBI-tips | Vega-Lite | Template JSON | 57 |
| Thys Templates | Thys van der Walt | Vega-Lite | Blog-embedded | 25 |
| vega-lite | Shad Frigui | Vega-Lite | Template JSON | 27 |
| Vega-Visuals | Giammaria | Vega | Raw spec (.vg.json) | 11 |
| DataViz-Vega | Andrzej Leszkiewicz | Vega | Raw spec | 31 |
| Power-Bi-Deneb | Juan-Power-bi | Vega-Lite | Template JSON | 11 |
| Deneb-Templates | clemviz | Vega-Lite | Template JSON | 10 |
| deneb-templates | vdvoorder | Vega-Lite | Template JSON | 3 |
| deneb_examples | pmoldmann | Vega-Lite | Template JSON (IBCS) | 4 |
| PBIQueryous/Deneb | PBI Queryous | Mixed | Mixed | Various |
| Flynnxx1/Deneb-Vega-Showcase | Flynnxx1 | Mixed | Mixed | Various |
| PMO_toolkit | DL0K-pbi | Mixed | Mixed | PMO charts |
Examples by Chart Type
Format column: T = Deneb Template JSON, S = Raw Spec JSON, B = Blog-embedded
Bar / Column
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Bar Chart | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/magnitude/bar-chart.deneb-template.json |
| Ordered Bar Chart | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/ranking/bar-chart-ordered.deneb-template.json |
| Infographic Bar Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Infographic%20Bar%20Chart/Spec.json |
| Infographic Column Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Infographic%20Column%20Chart/Spec.json |
| Simple Bar Chart | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Simple%20Bar%20Chart.json |
| Compact Bar + Cross-Filter | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Compact%20Bar%20Chart%20with%20Cross-Highlight%20Filter.json |
| Stacked Bar TwoCategories | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Stacked%20Bar%20TwoCategories.json |
| Bar Chart | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/2-bar-chart/ |
Bullet / Comparison / IBCS
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Bullet Graph | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/magnitude/bullet-graph.deneb-template.json |
| IBCS Three-Tier Chart | Andrzej Leszkiewicz | Vega | S | raw.githubusercontent.com/avatorl/DataViz-Vega/main/ibcs-three-tier-chart/ibcs-three-tier-chart.json |
| Actuals vs Forecasts Bullet | Shad Frigui | VL | T | raw.githubusercontent.com/shadfrigui/vega-lite/main/deneb-templates/actuals-vs-forecasts-bullet-like-chart/actuals-vs-forecasts-bullet-like-chart-deneb.json |
| Variance Chart | PBI-David | VL | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Variance%20Chart/Spec.json |
| IBCS Absolute Comparison | pmoldmann | VL | T | raw.githubusercontent.com/pmoldmann/deneb_examples/main/Two_Measure_Absolute_Compare/specification_pbi.json |
| IBCS Vertical Waterfall | pmoldmann | VL | T | raw.githubusercontent.com/pmoldmann/deneb_examples/main/ibcs_vertical_waterfall_with_start/ibcs_vertical_waterfall_with_start.json |
Line / Area / Time Series
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Line | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/change-over-time/line.deneb-template.json |
| Area | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/change-over-time/area.deneb-template.json |
| Column and Line | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/change-over-time/column-and-line.deneb-template.json |
| Brushable Line Chart | clemviz | VL | T | raw.githubusercontent.com/clemviz/Deneb-Templates/main/deneb_template_brush_line.json |
| Forecast Accuracy | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Forecast%20Accuracy.json |
| Patterned Area Between Lines | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Patterned%20Area%20Between%20Lines.json |
| Steamgraph | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Steam%20Over%20Time.json |
| Cumulative Line Chart | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/cumulative-line-chart/ |
| Temperature Line Area | Andrzej Leszkiewicz | Vega | S | raw.githubusercontent.com/avatorl/DataViz-Vega/main/temperature-line-area/temperature-line-area.json |
Slope / Bump / Ranking
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Slope | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/ranking/slope.deneb-template.json |
| Bump | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/ranking/bump.deneb-template.json |
| Slope Chart with Labels | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Slope%20Chart%20with%20Labels.json |
| Rank Chart | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/the-one-with-the-rank-chart/ |
KPI / Card
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Card Visual | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/1-card-visual/ |
| Conditional KPI Cards | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Conditional%20KPI%20Cards.json |
| KPI Card Area Gradient | clemviz | VL | T | raw.githubusercontent.com/clemviz/Deneb-Templates/main/KPI_cards/deneb_kpi_card_area_gradient.json |
Scatter / Bubble / Beeswarm
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Scatterplot | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/correlation/scatterplot.deneb-template.json |
| Bubble Plot | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/correlation/bubble-plot.deneb-template.json |
| Connected Scatterplot | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/correlation/connected-scatterplot.deneb-template.json |
| S&P Beeswarm Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/S%26P%20Beeswarm%20Chart/Spec.json |
| Cross-Highlighted Scatter | vdvoorder | VL | T | raw.githubusercontent.com/vdvoorder/deneb-templates/main/cross-highlighted-scatter-chart/template.json |
| Categorical Jittered Scatter | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Categorical%20Jittered%20Scatter%20Mean%20Overlay.json |
Heatmap / Calendar
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Heatmap | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/correlation/heatmap.deneb-template.json |
| Calendar Heatmap | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Calendar%20Heatmap/Spec.json |
| Calendar Heatmap + Histogram | clemviz | VL | T | raw.githubusercontent.com/clemviz/Deneb-Templates/main/heatmaps/deneb_calendar_heatmap_histo.json |
| Heatmap with Bars | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Heatmap%20with%20Bars.json |
| Warming Stripe | Andrzej Leszkiewicz | Vega | S | raw.githubusercontent.com/avatorl/DataViz-Vega/main/warming-stripe/warming-stripe.json |
| Calendar | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/the-one-with-the-calendar/ |
Donut / Pie / Part-to-Whole
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Donut | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/part-to-whole/donut.deneb-template.json |
| Pie | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/part-to-whole/pie.deneb-template.json |
| Treemap | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/part-to-whole/treemap.deneb-template.json |
| Parliament Diagram | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/part-to-whole/parliament-diagram.deneb-template.json |
| TopN Donut Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/TopN%20Donut%20Chart/Spec.json |
| Patterned Doughnut | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Patterned%20Doughnut.json |
| Waffle Charts | PBI-David | VL | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Waffle%20Charts/Spec.json |
| Marimekko | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/magnitude/marimekko.deneb-template.json |
Distribution (Boxplot / Violin / Histogram / Ridgeline)
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Boxplot | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/distribution/boxplot.deneb-template.json |
| Violin Plot | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/distribution/violin-plot.deneb-template.json |
| Histogram | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/distribution/histogram.deneb-template.json |
| Population Pyramid | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/distribution/population-pyramid.deneb-template.json |
| Raincloud Plot | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Raincloud%20Plot%20v1.json |
| Ridgeline Independent | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Ridgeline%20Independent.json |
| Boxplot | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/the-one-with-the-boxplot/ |
Waterfall
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Waterfall | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/flow/waterfall.deneb-template.json |
| Enhanced Waterfall | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Enhanced%20Waterfall.json |
Lollipop / Dumbbell / Comet
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Lollipop | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/magnitude/lollipop.deneb-template.json |
| Fancy Dumbbell | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Fancy%20Dumb%20Bell.json |
| Comet Chart | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Comet%20Chart.json |
| Dumbbell Chart | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/dumbbell-chart/ |
Gantt / Timeline
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Gantt Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Gantt%20Chart/Spec.json |
| Simple Gantt Chart | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Simple%20Gantt%20Chart.json |
| Hierarchical Gantt | Giammaria | Vega | S | raw.githubusercontent.com/Giammaria/Vega-Visuals/main/20240724-hierarchical-gantt-chart/ |
| Timeline | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/the-one-with-the-timeline/ |
Network / Flow / Sankey
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Sankey | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/flow/sankey.deneb-template.json |
| Chord Diagram | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/flow/chord.deneb-template.json |
| Network | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/flow/network.deneb-template.json |
| Force Directed Graph | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Force%20Directed%20Graph/Spec.json |
| Sankey Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Sankey%20Chart/Spec.json |
| Organisation Tree | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Organisation%20Tree%20Chart/Spec.json |
Radial / Radar / Spider
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Radar | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/magnitude/radar.deneb-template.json |
| Pancake Spider Chart | PBI-David | Vega | S | raw.githubusercontent.com/PBI-David/Deneb-Showcase/main/Pancake%20Spider%20Chart/Spec.json |
| Circular Radial Chart | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Circular%20Radial%20Chart%20Variant%202.json |
Map / Spatial
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Choropleth | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/spatial/choropleth.deneb-template.json |
| Dot Density Map | Andrzej Leszkiewicz | Vega | T | raw.githubusercontent.com/avatorl/Deneb-Vega-Templates/main/spatial/dot-density.deneb-template.json |
| Hex Map with Sparkline | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Hex%20Map%20with%20Sparkline.json |
| Spiked Map | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Spiked%20Map.json |
| Earthquakes Globe | Andrzej Leszkiewicz | Vega | S | raw.githubusercontent.com/avatorl/DataViz-Vega/main/earthquakes-globe/earthquakes-globe.json |
Tree / Hierarchy
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Radial Tree | PowerBI-tips | Vega | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Redial%20Tree.json |
| Simple Tree | PowerBI-tips | Vega | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Simple%20Tree.json |
| Tidy Tree Area | PowerBI-tips | Vega | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Tidy%20Tree%20Area.json |
| Zoomable Circle Packing | Giammaria | Vega | S | raw.githubusercontent.com/Giammaria/Vega-Visuals/main/20231203-zoomable-circle-packing/ |
Sparkline / Small Multiples
| Example | Author | Provider | Fmt | Fetch URL |
|---|---|---|---|---|
| Sparkline | Thys van der Walt | VL | B | https://thysvdw.github.io/posts/the-one-with-sparkline/ |
| Small Multiple Line | Andrzej Leszkiewicz | Vega | S | raw.githubusercontent.com/avatorl/DataViz-Vega/main/small-multiple-line-chart/small-multiple-line-chart-bike.json |
| Trellis Dot Plot | PowerBI-tips | VL | T | raw.githubusercontent.com/PowerBI-tips/Deneb-Templates/main/templates/Trellis%20Dot%20Plot.json |
Videos and Tutorials
| Resource | Author | URL |
|---|---|---|
| Sentido Analitica Playlist | Sentido Analitica | https://www.youtube.com/playlist?list=PLf18HMTT3dFhM6EI8Oim-cSYbhHaAvgZs |
| Power BI Guy Playlist | Power BI Guy | https://www.youtube.com/playlist?list=PL6oIJxyQvMGTxh4tREeKflcKVlOfGdyim |
| PowerBI.tips Season 3 | PowerBI.tips | https://www.youtube.com/playlist?list=PLn1m_aBmgsbEhKYRXC6Tq3e2FJubEND9b |
| Enterprise DNA Course | Enterprise DNA | https://portal.enterprisedna.co/p/introduction-deneb |
| PBI Queryous (Medium) | PBI Queryous | https://medium.com/@pbiqueryous |
AI Tools
| Tool | URL |
|---|---|
| Vicky Vega (Custom GPT for Vega specs) | https://bit.ly/VickyVega |
Deneb PBIR JSON Structure
Complete reference for how Deneb visuals are represented in PBIR format visual.json files.
Visual Container Structure
Minimal Deneb visual container:
{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.4.0/schema.json",
"name": "2c2722561a0b6c3deded",
"position": {
"x": 80,
"y": 56,
"z": 0,
"height": 280,
"width": 280,
"tabOrder": 0
},
"visual": {
"visualType": "deneb7E15AEF80B9E4D4F8E12924291ECE89A",
"query": {
"queryState": {
"dataset": {
"projections": [
{
"field": {
"Column": {
"Expression": {
"SourceRef": { "Entity": "Product" }
},
"Property": "Product"
}
},
"queryRef": "Product.Product",
"nativeQueryRef": "Product"
},
{
"field": {
"Measure": {
"Expression": {
"SourceRef": { "Entity": "Financials" }
},
"Property": "$ Sales"
}
},
"queryRef": "Financials.$ Sales",
"nativeQueryRef": "$ Sales"
}
]
}
}
},
"objects": {
"vega": [
{
"properties": {
"jsonSpec": {
"expr": {
"Literal": {
"Value": "'{\"data\": {\"name\": \"dataset\"}, \"mark\": {\"type\": \"bar\"}, \"encoding\": {\"y\": {\"field\": \"Product\", \"type\": \"nominal\"}, \"x\": {\"field\": \"$ Sales\", \"type\": \"quantitative\"}}}'"
}
}
},
"jsonConfig": {
"expr": {
"Literal": {
"Value": "'{}'"
}
}
}
}
}
]
},
"drillFilterOtherVisuals": true
}
}Literal Value Encoding Rules
All Deneb object properties use PBIR literal expressions. The encoding varies by type:
Booleans
Bare true or false (no quotes):
{"enableTooltips": {"expr": {"Literal": {"Value": "true"}}}}Numbers (D-suffix)
Append D to numeric values:
{"selectionMaxDataPoints": {"expr": {"Literal": {"Value": "50D"}}}}
{"scrollbarOpacity": {"expr": {"Literal": {"Value": "20D"}}}}Strings and Enums
Wrap in single quotes:
{"provider": {"expr": {"Literal": {"Value": "'vegaLite'"}}}}
{"renderMode": {"expr": {"Literal": {"Value": "'svg'"}}}}
{"selectionMode": {"expr": {"Literal": {"Value": "'simple'"}}}}JSON Specs (jsonSpec, jsonConfig)
Stringified JSON wrapped in single quotes. The entire Vega/Vega-Lite spec becomes a single-quoted string:
{"jsonSpec": {"expr": {"Literal": {"Value": "'{\"data\":{\"name\":\"dataset\"},\"mark\":\"bar\"}'"}}}}Deneb parses using JSONC (comments are supported inside the spec string).
Colors (solid fill structure)
{
"scrollbarColor": {
"solid": {
"color": {
"expr": {
"Literal": {"Value": "'#000000'"}
}
}
}
}
}Or bind to theme:
{
"scrollbarColor": {
"solid": {
"color": {
"expr": {
"ThemeDataColor": {"ColorId": 1, "Percent": 0}
}
}
}
}
}Query State (Field Bindings)
Fields are bound under visual.query.queryState.dataset.projections. Each projection contains:
| Property | Purpose |
|---|---|
field.Column or field.Measure | Field type and reference |
field.*.Expression.SourceRef.Entity | Table name |
field.*.Property | Column or measure name |
queryRef | Fully qualified reference (Table.Column) |
nativeQueryRef | Display name used in Vega specs |
displayName | Custom display name (if renamed) |
Field names in Vega-Lite encoding channels must match nativeQueryRef or displayName.
Sort Definition
{
"sortDefinition": {
"sort": [
{
"field": {
"Column": {
"Expression": {"SourceRef": {"Entity": "TableName"}},
"Property": "ColumnName"
}
},
"direction": "Ascending"
}
],
"isDefaultSort": true
}
}Object Properties
For the full list of Deneb object properties (vega, display, dataLimit, editor, stateManagement, developer), see references/capabilities.md. This file focuses on PBIR literal encoding.
All properties are stored under objects.<objectName>[0].properties and use the literal encoding rules above.
Complete PBIR Interactivity Example
Cross-filtering and tooltips with full PBIR literal encoding:
{
"objects": {
"vega": [
{
"properties": {
"jsonSpec": {
"expr": {"Literal": {"Value": "'{...}'"}}
},
"jsonConfig": {
"expr": {"Literal": {"Value": "'{}'"}}
},
"provider": {
"expr": {"Literal": {"Value": "'vegaLite'"}}
},
"renderMode": {
"expr": {"Literal": {"Value": "'svg'"}}
},
"enableTooltips": {
"expr": {"Literal": {"Value": "true"}}
},
"enableContextMenu": {
"expr": {"Literal": {"Value": "true"}}
},
"enableSelection": {
"expr": {"Literal": {"Value": "true"}}
},
"enableHighlight": {
"expr": {"Literal": {"Value": "false"}}
},
"selectionMaxDataPoints": {
"expr": {"Literal": {"Value": "50D"}}
},
"selectionMode": {
"expr": {"Literal": {"Value": "'simple'"}}
}
}
}
]
}
}Vega-Lite Chart Patterns for Deneb
Common chart patterns for Deneb visuals. All specs assume "data": {"name": "dataset"} and Vega-Lite v6 (bundled in Deneb 1.8+).
Bar Chart (Vertical)
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "bar", "tooltip": true, "cornerRadiusTopLeft": 4, "cornerRadiusTopRight": 4},
"encoding": {
"x": {"field": "Category", "type": "nominal", "sort": "-y"},
"y": {"field": "Sales", "type": "quantitative"},
"color": {"value": {"expr": "pbiColor(0)"}}
}
}Bar Chart (Horizontal)
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "bar", "tooltip": true, "cornerRadiusTopRight": 4, "cornerRadiusBottomRight": 4},
"encoding": {
"y": {"field": "Category", "type": "nominal", "sort": "-x"},
"x": {"field": "Sales", "type": "quantitative"}
}
}Bar Chart with Cross-Highlighting
Two-layer pattern: background shows full value at reduced opacity, foreground shows highlighted portion.
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"layer": [
{
"mark": {"type": "bar", "opacity": 0.3, "tooltip": true},
"encoding": {"x": {"field": "Sales"}}
},
{
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"x": {"field": "Sales__highlight"},
"opacity": {
"condition": {"test": {"field": "__selected__", "equal": "off"}, "value": 0},
"value": 1
}
}
}
],
"encoding": {
"y": {"field": "Category", "type": "nominal"},
"x": {"type": "quantitative"}
}
}Requires enableHighlight: true and enableSelection: true in visual objects.
Line Chart
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "line", "point": true, "tooltip": true, "strokeWidth": 2},
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": "Sales", "type": "quantitative"},
"color": {"field": "Region", "type": "nominal", "scale": {"scheme": "pbiColorNominal"}}
}
}Line Chart with Area Fill
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "area", "opacity": 0.15, "line": {"strokeWidth": 2}, "tooltip": true},
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": "Value", "type": "quantitative"},
"color": {"field": "Series", "type": "nominal", "scale": {"scheme": "pbiColorNominal"}}
}
}Scatter Plot
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "point", "tooltip": true, "filled": true, "opacity": 0.7},
"encoding": {
"x": {"field": "Revenue", "type": "quantitative"},
"y": {"field": "Profit", "type": "quantitative"},
"size": {"field": "Quantity", "type": "quantitative"},
"color": {"field": "Category", "type": "nominal", "scale": {"scheme": "pbiColorNominal"}}
}
}Heatmap
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "rect", "tooltip": true},
"encoding": {
"x": {"field": "Day", "type": "ordinal"},
"y": {"field": "Hour", "type": "ordinal"},
"color": {"field": "Value", "type": "quantitative", "scale": {"scheme": "pbiColorLinear"}}
}
}Donut Chart
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "arc", "innerRadius": 50, "tooltip": true},
"encoding": {
"theta": {"field": "Sales", "type": "quantitative", "stack": true},
"color": {"field": "Category", "type": "nominal", "scale": {"scheme": "pbiColorNominal"}},
"order": {"field": "Sales", "type": "quantitative", "sort": "descending"}
}
}Bullet Chart (Faceted with Target)
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"transform": [
{"window": [{"op": "rank", "as": "rank"}], "sort": [{"field": "Value", "order": "descending"}]},
{"filter": "datum.rank <= 10"}
],
"facet": {
"row": {
"field": "Category", "type": "nominal",
"sort": {"field": "Value", "order": "descending"},
"header": {"labelAngle": 0, "title": "", "labelAlign": "left"}
}
},
"spec": {
"layer": [
{"mark": {"type": "bar", "color": {"expr": "pbiColor(0, 0.7)"}, "size": 10}, "encoding": {"x": {"field": "Value", "type": "quantitative"}}},
{"mark": {"type": "tick", "size": 25, "color": {"expr": "pbiColor(0, -0.5)"}}, "encoding": {"x": {"field": "Target", "type": "quantitative"}}},
{"mark": {"type": "text", "align": "right", "dx": -5}, "encoding": {"x": {"value": -15}, "text": {"field": "Value", "format": ",.0f"}, "color": {"value": {"expr": "pbiColor(0, -0.3)"}}}}
]
}
}Lollipop Chart
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"encoding": {
"y": {"field": "Category", "type": "nominal", "sort": "-x"},
"x": {"field": "Value", "type": "quantitative"}
},
"layer": [
{"mark": {"type": "rule", "strokeWidth": 2, "color": {"expr": "pbiColor(0)"}}},
{"mark": {"type": "point", "filled": true, "size": 100, "color": {"expr": "pbiColor(0)"}}}
]
}Stacked Bar Chart
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"mark": {"type": "bar", "tooltip": true},
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": "Sales", "type": "quantitative"},
"color": {"field": "Region", "type": "nominal", "scale": {"scheme": "pbiColorNominal"}}
}
}Waterfall Chart
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"transform": [
{"window": [{"op": "sum", "field": "Amount", "as": "sum"}]},
{"window": [{"op": "lead", "field": "Category", "as": "lead"}]},
{"calculate": "datum.lead === null ? datum.Category : datum.lead", "as": "lead"},
{"calculate": "datum.Category === 'Total' ? 0 : datum.sum - datum.Amount", "as": "previous_sum"},
{"calculate": "datum.Category === 'Total' ? datum.sum : datum.Amount", "as": "amount"},
{"calculate": "(datum.Category !== 'Begin' && datum.Category !== 'Total' && datum.amount > 0 ? '+' : '') + datum.amount", "as": "text_amount"},
{"calculate": "(datum.sum + datum.previous_sum) / 2", "as": "center"},
{"calculate": "datum.sum < datum.previous_sum ? datum.sum : ''", "as": "sum_dec"},
{"calculate": "datum.sum > datum.previous_sum ? datum.sum : ''", "as": "sum_inc"}
],
"encoding": {
"x": {"field": "Category", "type": "ordinal", "sort": null}
},
"layer": [
{
"mark": {"type": "bar", "size": 45},
"encoding": {
"y": {"field": "previous_sum", "type": "quantitative", "title": "Amount"},
"y2": {"field": "sum"},
"color": {
"condition": [
{"test": "datum.Category === 'Begin' || datum.Category === 'Total'", "value": {"expr": "pbiColor(0)"}},
{"test": "datum.sum < datum.previous_sum", "value": {"expr": "pbiColor('negative')"}}
],
"value": {"expr": "pbiColor('positive')"}
}
}
},
{
"mark": {"type": "text", "dy": -4, "baseline": "bottom"},
"encoding": {
"y": {"field": "sum_inc", "type": "quantitative"},
"text": {"field": "sum_inc", "type": "nominal"}
}
}
]
}Sparkline (Small Multiple)
{
"$schema": "https://vega.github.io/schema/vega-lite/v6.json",
"data": {"name": "dataset"},
"facet": {"row": {"field": "Category", "type": "nominal", "header": {"labelAngle": 0, "title": ""}}},
"spec": {
"width": 200,
"height": 30,
"mark": {"type": "line", "strokeWidth": 1.5, "color": {"expr": "pbiColor(0)"}},
"encoding": {
"x": {"field": "Date", "type": "temporal", "axis": null},
"y": {"field": "Value", "type": "quantitative", "axis": null, "scale": {"zero": false}}
}
}
}Standard Config
Use examples/standard-config.json as a ready-to-use config file with any of the above specs. Key settings: autosize: fit, view.stroke: transparent, font: Segoe UI, clean axis styling.
Vega (Full) -- Basic Bar
For cases requiring signals, events, or fine-grained control:
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"data": [{"name": "dataset"}],
"padding": 5,
"width": {"signal": "pbiContainerWidth - 25"},
"height": {"signal": "pbiContainerHeight - 27"},
"scales": [
{"name": "xscale", "type": "band", "domain": {"data": "dataset", "field": "Category"}, "range": "width", "padding": 0.1},
{"name": "yscale", "type": "linear", "domain": {"data": "dataset", "field": "Sales"}, "range": "height", "nice": true}
],
"marks": [
{
"type": "rect",
"from": {"data": "dataset"},
"encode": {
"enter": {
"x": {"scale": "xscale", "field": "Category"},
"width": {"scale": "xscale", "band": 1},
"y": {"scale": "yscale", "field": "Sales"},
"y2": {"scale": "yscale", "value": 0},
"fill": {"signal": "pbiColor(0)"}
}
}
}
]
}Note: In Vega, data is an array [{"name": "dataset"}], not an object. Use pbiContainerWidth/pbiContainerHeight signals for responsive sizing.