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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
JayWee
Frequent Visitor

Gradual Line Color Change Based On Test Conditions

Morning All,

 

Can i please find out whether does Deneb capable of producing line chart with gradual color changes based on test conditions?

 

Thus far, i only able to create the top line chart with my current knowledge.

 

What i need is to replicate what Tableau can achieve in the bottom chart.

 

DenebDenebTableauTableau

 

Please advice.

 

Thanks in advance.

 

Jay

3 REPLIES 3
v-csrikanth
Community Support
Community Support

HI @JayWee 

Thanks for reaching out to the Fabric Community.
Sorry for the late response.
Yes, Deneb is capable of replicating this Tableau-like behavior using Vega-Lite's conditional encoding features.

To mimic the gradient or conditional color behavior in the second chart (based on thresholds or logic like average/std deviation), you can use the color encoding with a condition. Below is a simplified example of how you might apply color logic to change the line or point color based on value:
***********************************************************
{
"data": {
"name": "dataset"
},
"transform": [
{
"fold": ["Value"],
"as": ["Metric", "Value"]
}
],
"mark": {
"type": "line",
"point": true
},
"encoding": {
"x": {
"field": "XLabel",
"type": "ordinal"
},
"y": {
"field": "Value",
"type": "quantitative"
},
"color": {
"condition": [
{
"test": "datum.Value > 3",
"value": "red"
},
{
"test": "datum.Value > 2",
"value": "orange"
}
],
"value": "blue"
}
}
}
***********************************************************

Tips:
Adjust the test conditions based on your thresholds (e.g. Std > 2.5, Avg > some constant).

For smoother gradients, you can use a scale for color like "scale": {"scheme": "redyellowgreen"} with "field": "Value".

If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.



Akash_Varuna
Super User
Super User

Hi @JayWee Could you check this video it will give you a prespective 
https://www.youtube.com/watch?v=T2KJRY92YUk
It is not exactly your output but still it might help for your use case 

Hi Akash,

 

Thanks for the rapid reply.

 

Just had a quick look and seems like its using its native line chart and using a solid instead of gradual color transition.

I'm using Deneb for my graphs, so might not work on my end.

 

Thanks again.

 

Jay 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.