Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
DW868990
Helper IV
Helper IV

Deneb Vega Lite Table - Need to show values of zero

Hi,

 

I have created the below table in Deneb using vega lite, i need it to show all of the bin values that are the x axis, including ones where the value is zero, at present it only shows bin sizes that have a value in.

 

DW868990_0-1674042608281.png

 

My current code is below:
{
"data": {"name": "dataset"},

"encoding":{
"y": {
"field": "Category",
"title": null,
"sort": "descending"
},
"x": {
"field": "Bin Name",
"type": "nominal",
"sort": {"field": "Min"},
"axis": {
"orient": "bottom",
"title": null
}
},
"tooltip": [
{"field": "Category"},
{"field": "Bin Name"},
{"field": "Metric"}
]
},

"layer": [
{
"mark": {"type": "rect"},
"encoding": {
"color": {
"field": "Metric",
"scale":{
"scheme": "lightgreyteal"
},
"legend": null
}
}
}
]
}

Any advice appreciated.

Regards,

JJ

1 ACCEPTED SOLUTION
giammariam
Solution Sage
Solution Sage

Hi @DW868990. It's hard to tell without seeing a sample of your dataset, but it looks like the bins are created outside of Deneb and then passed in to be used as the x-axis. A different approach would be to pass the raw values in and then perform the binning in vega-lite. Then you could explicitly set the scale domain values. 

If this is enough info to get you closer to what you are after, then please consider marking this as the solution. However, if you are willing to provide a representive mock dataset, I'd be happy to try to provide a more thorough answer and a vega-lite spec. 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

View solution in original post

1 REPLY 1
giammariam
Solution Sage
Solution Sage

Hi @DW868990. It's hard to tell without seeing a sample of your dataset, but it looks like the bins are created outside of Deneb and then passed in to be used as the x-axis. A different approach would be to pass the raw values in and then perform the binning in vega-lite. Then you could explicitly set the scale domain values. 

If this is enough info to get you closer to what you are after, then please consider marking this as the solution. However, if you are willing to provide a representive mock dataset, I'd be happy to try to provide a more thorough answer and a vega-lite spec. 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Do you frequently use Deneb to provide insights to your stakeholders? Have you considered sponsoring this free and open source custom visual? More info here!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors