Forum Discussion

Fusilier2's avatar
Fusilier2
Helper V
1 year ago
Solved

Why is conditional text formatting so complicated?

Trying to simply colour my value in a KPI visual.

 

Equal to or Greater than 0 = Green

Less than 0 = Red 

 

So far I have this:

But what happens if the min is greater than 0 or the max is less than 0???

Sorry, I don't understand the logic in this.

  • Hey,

    I understand the confusion.
    The key thing to remember is that you need a True / True condition for the color change to happen.

    Example 1 (min greater than 0)

    • min: 14

    • max: 50

    • value: 34

    You’ll get:

    • First rule: True / True

    • Second rule: True / False
      → The green color will be applied.

    Example 2 (max less than 0)

    • min: -50

    • max: -2

    • value: -35

    You’ll get:

    • First rule: False / False

    • Second rule: True / True
      → Again, since one of the rules is fully True, the color will be applied.

    Keep in mind: it’s not about the value being in between min and max  these are two separate rules, and both parts of a rule need to be True for the color to be applied.

     

    Hope it helps!

5 Replies

  • Hey,

    I understand the confusion.
    The key thing to remember is that you need a True / True condition for the color change to happen.

    Example 1 (min greater than 0)

    • min: 14

    • max: 50

    • value: 34

    You’ll get:

    • First rule: True / True

    • Second rule: True / False
      → The green color will be applied.

    Example 2 (max less than 0)

    • min: -50

    • max: -2

    • value: -35

    You’ll get:

    • First rule: False / False

    • Second rule: True / True
      → Again, since one of the rules is fully True, the color will be applied.

    Keep in mind: it’s not about the value being in between min and max  these are two separate rules, and both parts of a rule need to be True for the color to be applied.

     

    Hope it helps!

    • v-venuppu's avatar
      v-venuppu
      Community Support

      Hi Fusilier2 ,

      I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.

      Thank you.

  • But what happens if the min is greater than 0 or the max is less than 0???

    That doesn’t make sense to me. How can the MIN be greater than the MAX?
    By definition, the MIN and MAX values will always reflect the smallest and largest values in the current context.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi Fusilier2 ,

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi Fusilier2 ,

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

    Thank you.