Deneb in Power BI: Vega-Lite Custom Visual Examples & Templates (2026)
· Power BI
How to install Deneb in Power BI and build custom Vega-Lite visuals: copy-paste templates for bar charts, scatters, heat maps and small multiples, plus fixes for blank visuals.
Power BI's default visuals cover 90% of reporting needs—but the most memorable dashboards use the remaining 10%. Deneb is a certified custom visual that brings the Vega-Lite grammar into Power BI, letting you craft publication-quality charts that match your exact narrative. If you have ever been told "that chart doesn't exist in Power BI," Deneb is the escape hatch.
What Is Deneb?
Deneb is a certified Power BI custom visual that lets you write Vega-Lite specifications directly inside Power BI. It bridges the gap between Power BI's data model and the expressive Vega-Lite visualization grammar, enabling almost any chart you can describe in JSON. Think of it as web-grade visualization flexibility living inside your Power BI report, fully integrated with your data model.
Why Choose Deneb?
- Total control over every visual element—from a single bar's corner radius to the legend's typography.
- Native data binding so you do not rebuild your data layer.
- Power BI interaction support when configured appropriately and backed by identifiable data points; test selection after aggregating or reshaping data.
- Responsive layouts that adapt cleanly to desktop, tablet, and phone canvas sizes.
- SVG or Canvas rendering through Vega; performance depends on mark count, transforms and the chosen renderer.
Getting Started with Deneb
Setup takes only a few minutes:
- Download Deneb from AppSource (Power BI Desktop > Insert > Get more visuals > AppSource).
- Import the visual into your report.
- Add the Deneb visual to your canvas.
- Add the fields and measures needed by the specification to Deneb's Values role, then inspect the dataset in the editor.
You do not need to be a programmer—the learning curve is gentle, especially if you start with the built-in templates.
The Deneb Editor
Deneb's editor opens from the button on the visual's hover toolbar, not from the Format pane. It gives you:
- Syntax highlighting for JSON and Vega-Lite properties.
- A preview that updates as you edit, so you iterate against real data instead of guessing.
- Schema-aware validation with inline errors for unknown properties or typos.
- Built-in templates for common chart types, a reliable starting point for first visuals.
The editor splits into the specification pane, a data-preview pane showing exactly what rows the visual receives, and the rendered preview. Keep the data preview visible while debugging — most “broken” specs are actually a field-name or type mismatch visible in that pane.
Vega-Lite Fundamentals
Basic Structure
Every Vega-Lite specification follows the same skeleton: data, mark, encoding.
{
"data": { "name": "dataset" },
"mark": "bar",
"encoding": {
"x": { "field": "Region", "type": "nominal" },
"y": { "field": "Sales", "type": "quantitative" }
}
}
That is genuinely the minimum. The data property is handled automatically by Deneb, so in practice you only need to think about what you want to draw and which field controls each visual property.
Four Concepts Worth Memorizing
- Marks: the visual element—
bar,point,line,area,rect,text,boxplot, and more. - Encodings: the bridge from data to visual properties—
x,y,color,size,shape,tooltip. - Scales: the rules that map raw data to pixel values (linear, log, band, ordinal).
- Guides: the reference furniture—axes, legends, titles, annotations.
Master these four and you can read almost any Vega-Lite specification you find online.
A Complete, Working Spec You Can Paste Today
The examples below are deliberately partial so each one highlights a single idea. For a first ten minutes, though, you want one spec that renders end-to-end. Add Region and Sales to Deneb's Values well, then paste:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": { "name": "dataset" },
"mark": { "type": "bar", "cornerRadiusEnd": 3 },
"encoding": {
"x": { "field": "Region", "type": "nominal", "title": null,
"sort": "-y", "axis": { "labelAngle": 0 } },
"y": { "field": "Sales", "type": "quantitative",
"title": "Sales (USD)", "axis": { "format": "$,.0s" } },
"color": { "field": "Sales", "type": "quantitative",
"scale": { "scheme": "blues" }, "legend": null },
"tooltip": [
{ "field": "Region", "type": "nominal" },
{ "field": "Sales", "type": "quantitative", "format": "$,.0f" }
]
}
}
Three things to notice before changing anything else:
"data": { "name": "dataset" }is how Deneb injects the rows from the Values well — you never supply the rows yourself.- Field names are matched to the Values well exactly, including case and spacing; rename a column in Power BI and the spec silently breaks until it is updated to match.
- The order of the visual fields does not matter; only the spec controls what is drawn.
Field setup check: Region as nominal, Sales as quantitative aggregated to Sum. If the preview shows thousands of tiny segments instead of four bars, the Sales field is arriving unaggregated — fix the aggregation in the field well or with an aggregate transform, not by padding the spec.
Building Your First Custom Visual
Bar Chart with Reference Line
A common ask: show sales by region with a target line.
{
"data": { "name": "dataset" },
"layer": [
{
"mark": { "type": "bar", "cornerRadiusEnd": 3 },
"encoding": {
"x": { "field": "Region", "type": "nominal", "title": null, "axis": { "labelAngle": 0 } },
"y": { "field": "Sales", "type": "quantitative" },
"color": {
"field": "Sales",
"type": "quantitative",
"scale": { "scheme": "blues" },
"legend": null
}
}
},
{
"mark": { "type": "rule", "color": "#d13438", "strokeWidth": 2 },
"encoding": {
"y": { "datum": 1000000 }
}
}
]
}
The layer property stacks multiple marks in one visual. Here, a bar layer carries the data while a rule layer draws the target.
Scatter Plot with a Third Dimension via Size
{
"data": { "name": "dataset" },
"mark": { "type": "circle", "opacity": 0.7, "stroke": "white", "strokeWidth": 1 },
"encoding": {
"x": { "field": "AdSpend", "type": "quantitative", "title": "Ad Spend ($)" },
"y": { "field": "Revenue", "type": "quantitative", "title": "Revenue ($)" },
"size": {
"field": "Customers", "type": "quantitative",
"scale": { "range": [50, 1500] },
"legend": { "title": "Customers" }
},
"color": { "field": "Channel", "type": "nominal" },
"tooltip": [
{ "field": "Region", "title": "Region" },
{ "field": "AdSpend", "title": "Ad Spend", "format": "$,.0f" },
{ "field": "Revenue", "title": "Revenue", "format": "$,.0f" },
{ "field": "Customers", "title": "Customers" }
]
}
}
A scatter plot is now communicating four dimensions: x position, y position, size, and color. The tooltip adds depth on hover.
Heat Map with the Viridis Scheme
{
"data": { "name": "dataset" },
"mark": "rect",
"encoding": {
"x": { "field": "Day", "type": "ordinal" },
"y": { "field": "Hour", "type": "ordinal" },
"color": {
"field": "Volume", "type": "quantitative",
"scale": { "scheme": "viridis" },
"legend": { "title": "Order Volume" }
}
}
}
Viridis is perceptually uniform—meaning equal data steps look like equal color steps to the eye—which makes it ideal for continuous data and colorblind viewers.
Advanced Visualization Techniques
Custom Combination Charts
One of Deneb's superpowers is layered composition. Build a chart that shows actual revenue (bar) alongside a moving average (line) and a target (rule) in a single visual. The layer property accepts an array of mark/encoding pairs; each layer can carry its own data, transforms, and interactivity.
Faceted Small Multiples
Use facet to repeat a chart across categories—twelve monthly trend charts in a 4×3 grid, for example. Small multiples make patterns obvious that would be lost in a single cluttered chart.
{
"data": { "name": "dataset" },
"facet": { "field": "Product", "type": "nominal", "columns": 3 },
"mark": "line",
"encoding": {
"x": { "field": "Month", "type": "temporal" },
"y": { "field": "Sales", "type": "quantitative" }
}
}
Dynamic Annotations
{
"mark": { "type": "text", "align": "left", "dx": 5, "dy": -5 },
"encoding": {
"x": { "field": "Date", "type": "temporal" },
"y": { "field": "Sales", "type": "quantitative" },
"text": { "field": "Note", "type": "nominal" }
}
}
Add a text layer that places annotations only where a Note field is non-empty.
Interactive Features
Conditional Formatting via Encoding Conditions
"color": {
"field": "Variance",
"type": "quantitative",
"condition": { "test": "datum.Variance < 0", "value": "#d13438" },
"scale": { "scheme": "greens" }
}
Negative variances get an explicit red, positive values follow the green gradient.
Rich Tooltips
Tooltips are arrays of objects, each with field, title, and format. Add multiple lines, formatted numbers, and even custom fields derived in transforms.
"tooltip": [
{ "field": "Region", "title": "Region" },
{ "field": "Revenue", "title": "Revenue", "format": "$,.0f" },
{ "field": "YoY", "title": "YoY", "format": ".1%" }
]
Selection-Based Highlighting
{
"params": [
{ "name": "hover", "select": { "type": "point", "on": "mouseover" } }
],
"mark": { "type": "circle", "opacity": 0.6 },
"encoding": {
"size": {
"condition": { "test": { "param": "hover", "empty": false }, "value": 300 },
"value": 80
}
}
}
This creates a hover-highlighted scatter plot—points grow when the user points at them.
Integrating with Power BI
Cross-Filtering
Incoming report filters affect Deneb's dataset. Outgoing selection requires the applicable interactivity settings and identifiable data points. Aggregation or custom transforms can affect identity resolution, so test actual click behaviour; a Vega-Lite selection parameter alone is not a guarantee of cross-filtering other report visuals. Consult Deneb's interactivity documentation.
Theming with Report Themes
Reference your report theme colors directly:
"encoding": {
"color": {
"field": "Category",
"type": "nominal",
"scale": { "scheme": "pbiColorNominal" }
}
}
Swap pbiColorNominal for your theme name and the visual inherits the report's palette automatically.
Parameters and What-If Analysis
Reference Power BI parameters and What-If slicers inside your specification:
"transform": [
{ "calculate": "datum.Revenue * (1 + datum.DiscountPct)", "as": "NetRevenue" }
]
Users adjust the parameter on a slicer, the calculated field updates, and the chart redraws in real time.
Bookmark and Button Integration
Deneb visuals participate fully in bookmarks. Capture filter states, zoom levels, and selection states, then switch between them via navigation buttons—classic guided analytics, with custom visuals driving the story.
Best Practices
Design with Purpose
- Every visual element should earn its place. If it does not contribute to understanding, remove it.
- Choose colorblind-safe schemes by default; reserve aggressive palettes for outlier emphasis.
- Test on phone-sized and ultrawide canvases. Use
widthandheightcontainers, not pixel values, where possible. - Provide context through titles, axis labels, and annotations—the chart should still make sense in a screenshot.
Optimize for Performance
- Aggregate before you visualize: pre-compute rollups in Power Query or DAX, then send the smaller dataset to Deneb.
- Pick efficient mark types:
barandlineare cheap;pointwith large datasets is expensive. - Limit encodings: every added encoding costs cycles. Three well-chosen encodings beat seven mediocre ones.
- Sample large datasets: use a
filterorsampletransform to cap mark count when full fidelity is not needed.
Maintainability
- Keep one specification per visual, named clearly (e.g.,
SalesByRegion_Deneb.json). - Add a header comment with the visual's purpose and the source dataset.
- Version-control specifications in a shared repository alongside your
.pbixfiles. - Document any custom transformations and the assumptions behind them.
Advanced Use Cases
Sankey Diagrams
Show flow and proportional relationships between stages of a process—sales funnel, customer journey, supply chain. Vega-Lite supports layered bars and arcs that approximate Sankey visuals; for full Sankey rendering, consider the companion Vega (not Vega-Lite) mode in Deneb.
Calendar Heatmaps
Reveal time-based patterns across days, weeks, and months—useful for support volume, sales seasonality, and engagement metrics.
{
"data": { "name": "dataset" },
"mark": "rect",
"encoding": {
"x": { "field": "date", "type": "ordinal", "timeUnit": "date" },
"y": { "field": "date", "type": "ordinal", "timeUnit": "day" },
"color": { "field": "value", "type": "quantitative", "scale": { "scheme": "viridis" } }
}
}
Network and Relationship Graphs
For force-directed network layouts, use full Vega and its force transform rather than assuming Vega-Lite provides a force layout. Chord layouts also need a deliberately prepared layout or full Vega specification.
Parallel Coordinates
{
"data": { "name": "dataset" },
"mark": "line",
"encoding": {
"x": { "field": "Metric", "type": "nominal", "scale": { "type": "point" } },
"y": { "field": "Value", "type": "quantitative" },
"color": { "field": "Segment", "type": "nominal" },
"detail": { "field": "CustomerID" }
}
}
Parallel coordinates reveal multi-dimensional patterns at a glance—ideal for customer segmentation analysis.
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
| Visual is blank | Field names do not match Power BI | Match case exactly; use the field picker, not free text |
| Mark count too high | Unaggregated data | Add an aggregate transform or aggregate in DAX |
| Slow interaction | Too many marks or expensive encodings | Pre-aggregate, simplify encodings, sample |
| Cross-filtering missing | Interactivity settings or lost data-point identity | Review selection support and transforms; test with unaggregated identifiable points |
| JSON parse error | Trailing comma or unquoted key | Validate JSON in your editor; Vega-Lite is strict |
Debugging Workflow
- Reduce the dataset to ten rows—if it renders, your specification is fine and the issue is data scale.
- Comment out
encodingchannels one at a time to isolate the failing property. - Open Developer Tools in the service (F12) and inspect console errors for transform failures.
- Reference the Vega-Lite documentation; the schema is exhaustive and well-maintained.
Deep Dive — Vega-Lite Specification Anatomy
The Mark Property
The mark property defines the visual primitive. Each mark type suits a different story:
bar,point,line,area,tick: the everyday workhorses.rect,square,circle: great for heat maps and categorical grids.boxplot,errorband,errorbar: statistical distribution.text,geoshape: annotation and cartography.
The Encoding Channels
- Position (
x,y,x2,y2): the foundation—highly optimized and almost always necessary. - Color (
color,fill,stroke): categorical or continuous differentiation. - Size (
size): adds a quantitative dimension; expensive on large datasets. - Shape (
shape): categorical, useful when color is insufficient. - Tooltip (
tooltip): zero rendering cost; do not skimp on tooltips.
Scales and Legends
- Linear: continuous numerical data, evenly distributed.
- Log: wide-ranging values where linear compression hides detail.
- Band: categorical positioning for bar charts.
- Ordinal: discrete categorical to visual mapping (colors, sizes).
- Sequential / Diverging: built-in palettes for continuous data (
viridis,redblue,blues).
Transforms
"transform": [
{ "filter": "datum.Sales > 0" },
{ "calculate": "datum.Revenue - datum.Cost", "as": "Profit" },
{ "aggregate": [{ "op": "sum", "field": "Profit", "as": "TotalProfit" }],
"groupby": ["Region"] }
]
Use filter, calculate, aggregate, bin, and timeUnit transforms to shape data before it hits the encoding stage.
Real-World Business Applications
Financial Reporting
- Custom waterfall charts with precise control over positive and negative contributions.
- Clustered variance charts comparing budget to actual with drill-down.
- Gauges tied to specific KPI thresholds rather than generic ranges.
- Sparkline arrays embedded in tables to surface 12-month trends without taking up extra space.
Customer Analytics
- Parallel coordinates plots to reveal multi-dimensional customer segments.
- Cohort retention heatmaps to track behavior over time.
- Custom funnel visualizations for pipeline and conversion analysis.
- Behavior flow diagrams for digital journeys.
Operations and Supply Chain
- Geographic overlays combining warehouse locations, shipment status, and demand hotspots.
- Gantt-style timeline views for logistics scheduling.
- Multi-layer operational dashboards combining KPIs, trends, and exceptions.
A current workflow: AI drafts, governed measures, custom visuals
An AI assistant can draft a Vega-Lite specification, but a plausible JSON object is not proof that the chart is correct. Provide the actual field names, intended grain and desired comparison. Validate the specification, compare totals against a native table, and test incoming filters and outgoing selection separately.
Power BI Copilot should not be treated as a guaranteed Deneb editor or a way to bypass custom-visual policies. Use the Copilot readiness checklist for its supported model-grounding workflow. Keep reusable financial definitions in DAX measures; use Deneb transforms for visual layout, not a second undocumented ledger.
For a more involved full-Vega example, the world population map guide includes a downloadable specification and explains geographic field mapping. If rendering is slow, start with model performance and the size of the data passed to Deneb before adding more marks.
Where Custom Visuals Are Heading
Microsoft's continued investment in custom visuals—and the broader Power BI ecosystem—signals that differentiation through visualization is here to stay. As organizations accumulate more data, the ability to visualize it in unique, branded ways is becoming a competitive moat. Deneb sits squarely at the intersection of power and accessibility, offering web-grade visualization without requiring software-development expertise.
The learning curve is real but manageable. Start with a template, modify one property at a time, and within a few hours you will be comfortable enough to build bespoke visuals for your most demanding stakeholders.
Summary
Custom visuals are the difference between showing data and telling a story. Deneb and Vega-Lite give you the grammar to craft that story precisely, while Power BI gives you the data, governance, and distribution to put it in front of decision-makers.
- Start simple: edit a template before writing one from nothing.
- Build gradually: layer marks, transforms, and interactivity step by step.
- Iterate with users: every visual gets better after a single round of stakeholder feedback.
- Reuse your work: a well-built Deneb specification becomes a building block for every future report.
The combination of Power BI's modeling engine and Deneb's expressive grammar is a force multiplier. The next time a stakeholder asks for a chart that "doesn't exist yet," you will know exactly how to build it.
Need a custom Deneb visual built for you?
I build bespoke Deneb and Vega-Lite visuals for finance and board reporting: variance bridges, small multiples, KPI cards and interactive maps that standard Power BI visuals cannot draw. You get the finished spec, documentation and a handover so your team can maintain it.
See the Power BI custom visuals service or send a brief for a fixed quote. For ready-made starting points, try the revenue variance SVG template and the HTML bar chart template.