# Color code a rising or falling gauge value

**URL:** <https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294>\
**Category:** Help\
**Tags:** gauge\
**Created:** [December 11, 2018, 3:12am UTC](https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294 "2018-12-11T03:12:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WoobaGooba](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/woobagooba/32/507_2.png) [@WoobaGooba](https://forums.losant.com/u/WoobaGooba)\
**Post date:** [December 11, 2018, 3:12am UTC](https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294/1 "2018-12-11T03:12:07Z")

</div>

Apologies if this is described somewhere, I can not locate the information re: how to form the conditional.

---

<div class="post-metadata">

**Author:** ![Erin\_Thompson](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/erin_thompson/32/501_2.png) [@Erin\_Thompson](https://forums.losant.com/u/Erin_Thompson)\
**Post date:** [December 11, 2018, 2:14pm UTC](https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294/2 "2018-12-11T14:14:44Z")

</div>

Hi,

Here is the documentation on the [Gauge Dashboard Block](https://docs.losant.com/dashboards/gauge/), and you want to look under the section that says “Conditional Gauge Colors”.

Hope that helps,  
Erin

---

<div class="post-metadata">

**Author:** ![WoobaGooba](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/woobagooba/32/507_2.png) [@WoobaGooba](https://forums.losant.com/u/WoobaGooba)\
**Post date:** [December 11, 2018, 4:15pm UTC](https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294/3 "2018-12-11T16:15:30Z")

</div>

Yes thanks already digested all of that. My question is how to author the conditional expression to detect an increasing or decreasing {{value}}. (calculation of the first derivative, comparison with past value, or equivalent etc.)

---

<div class="post-metadata">

**Author:** ![Erin\_Thompson](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/erin_thompson/32/501_2.png) [@Erin\_Thompson](https://forums.losant.com/u/Erin_Thompson)\
**Post date:** [December 11, 2018, 7:37pm UTC](https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294/4 "2018-12-11T19:37:16Z")

</div>

Sorry about the confusion. Currently, there is no way to get a previous value of the gauge. But that is a great feature request, which I will file a ticket for and post back once it is completed.

Best,  
Erin

---

<div class="post-metadata">

**Author:** ![WoobaGooba](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/woobagooba/32/507_2.png) [@WoobaGooba](https://forums.losant.com/u/WoobaGooba)\
**Post date:** [December 26, 2018, 5:58pm UTC](https://forums.losant.com/t/color-code-a-rising-or-falling-gauge-value/1294/5 "2018-12-26T17:58:22Z")

</div>

Considering this further. Is it possible to set a gauge’s specified device/attribute color code using a conditional expression based on a different device attribute?

What I’m considering … have the workflow set both the actual value AND a 1st derivative attribute on the device. The dashboard gauge would be based on the value attribute with the color code determined by the 1st derivative attribute.
