Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Conditional Formatting in concatenated text

Hey there, looks like I need your help again. These forums are something else, never failed me before. 1. What do we have?   There are gates, an there is thing called "readiness". It reflects...
  • v-xiaotang's avatar
    4 years ago

    Hi Anonymous 

    Thanks for reaching out to us.

    >>  ...they have merged readiness via "concatenation". ....It is easy to conditionally format when there is one value.... But how do I format them when they are merged?

    One idea: 

    first, you need to judge whether the [Readiness of Upcoming Gate(s)] contains one value or two values. You can use length() to judge here. If the length exceeds a certain value, it contains two values. You can also use CONTAINSSTRING(), e.g.


    Then, if it's one value, use the original code; if it's two values, you need to split it. For example, if the value is less than 18%, set the background color to yellow

    create the measures,

     

    max thresholds = 
    var _row= MIN('Table'[Readiness of Upcoming Gate(s)])
    return IF(LEN(_row)>8,value(LEFT(_row,SEARCH(",",_row)-2))/100)
    min thresholds = 
    var _row= MIN('Table'[Readiness of Upcoming Gate(s)])
    var _v1=IF(LEN(_row)>8,RIGHT(_row,SEARCH(",",_row)-1))
    var _v2=LEFT(_v1,LEN(_v1)-1)
    return IF(LEN(_row)>8,_v2/100)
    Measure = 
    var _row= MIN('Table'[Readiness of Upcoming Gate(s)])
    var _color= "yellow"
    return IF(LEN(_row)>8,IF([max thresholds]<0.18|| [min thresholds]<0.18,_color))

     

    put [Measure] into  conditional formatting

    result

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.