Deneb has made a significant impact in the Power BI visualization space since its introduction. Like Charticulator before it, Deneb provides a way for report creators to take advantage of the Vega and Vega-Lite libraries to build custom visuals. Additionally, you can save them as templates and reuse them. So, if you have a specific look or style guide that is unique to your organization, Deneb allows you to fit the visual to the style and replicate it again and again.
This article introduces Deneb, focusing on building one of the workhorses of data visualization: a horizontal bar chart.
Getting Started
For this demonstration, I just used the sample data that comes with every Power BI Desktop file.

For modeling, I just made dimension tables for Countries, Products, Discount Bands, and Segments.

For this walk through, I only created one measure:
Sum of Sales = SUM (FactFinancials[Sales] )
With that as a baseline, here we go!
Making a Simple Bar Chart
After adding Deneb as a custom visual to the Visualizations pane, drag it onto a canvas page. Add Product and the Sum of Sales measure to the values well. After that, click the ellipsis (…) on the top right of the visual, then click “Edit”.

After that, select the option to create a visual using Vega-Lite. For your Vega-Lite template, select ‘Simple bar chart’. Once you do that, you should see an option for choosing a category and a measure. For category, select Product. For measure, select Sum of Sales. It should look like this:

Once you get to this point, click create. You should see this bar chart:

We’ve reached stage “Hello World”! We have a working horizontal bar chart. You can see the JSON specification on the left side and a bar chart on the right side. Nothing earth-shattering, but it’s a start.
Now I will try to explain how to do a few things to customize this a little further.
Cleaning Up the Chart
Personally, I tend to think less is more on a chart. I am not a fan of gridlines, for one. But how would you remove them?
On this chart, the gridlines are on the x-axis. To remove them, you go into the JSON specification and edit the x-axis like so:
"x": {
"field": "Sum of Sales",
"type": "quantitative",
"axis": {
"grid": false
}
}
}
The axis property is where, unsurprisingly, you make edits to things like ticks, labels, axis titles, and many other things. For now, we will make this slight change and hit CTRL+ENTER. You should now see no gridlines:

But what about sorting by the measure in descending order? That’s pretty simple too. For this visual, we want to sort the y-axis by the measure in descending order that is on the x-axis. To do this, we add a sort property on the y-axis and set it to “-x”:
"y": {
"field": "Product",
"type": "nominal",
"sort":"-x"
}
Your bar chart is now sorted in descending order (after hitting CTRL+ENTER):

Again, nothing earth-shattering. But tiny tweaks make it simple to edit the chart as you need it.
But Why Would I Use This?
The big question. What is in it for me? Especially when everything I just showed you can be easily achieved in a core visual.
For me, it is the flexibility and ability to replicate something for other reports. This button in the Deneb visual allows you to create a reusable template of something you put together using Deneb:

Once you generate and save this template, it can become part of your own visual grammar. I liken this functionality to how Power Apps has Component Libraries. With Canvas Apps, you can create a component from many different controls. Do you have a bottom navigation bar that you want to use across all of your mobile apps? Create a new component in the Component Library! You can then import that into any Canvas App and push any changes from the component library. Built once, replicated many times.
For visuals in Power BI, there is no central place where individual developers can save their own visual components. Yes, you can import custom visuals and create template files, but nothing compares to what Power Apps offers with its Component Library.
Deneb helps bridge the gap. You can save your templates to a common location (like GitHub) and point people to it. They can then import your templates and be on their merry way.
Extended Example
To enhance my understanding, I decided to edit the bar chart further. Here is what I did:
- Rounded the right corners a little
- Put the labels on top of the bar themselves
- Added formatted data labels (without formatting the labels beforehand)
- Removing axis information and making a simple title
Here is what I came up with:

Overall, I think it came out pretty well! Here is a gist of the code.
Next Steps
I am going to continue on with making a bunch of different bar charts. For your own learning, I recommend the following in terms of training:
- Power BI Guy has an excellent playlist on YouTube
- The Deneb site has a great list of resources.
One thing that has been especially help for me is trying to reverse-engineer something already done. I tend to go to the Vega-lite examples page and go from there.
It may seem daunting to learn to code visuals, but I’ve found Vega-Lite to be really accessible. Being able to use it inside of Power BI is a win-win. Hopefully, you find the same value too.
