Forum Discussion

inglexjc's avatar
inglexjc
Post Patron
3 years ago
Solved

Color coding with Multiple Colors with Multiple Text in same column

I have a table called 'Legal Files' column name is Description_1 (Visual shows Description).

 

I was able to color code when "Letter Waived" is in the column to show the font as BLUE.  But now it's been asked to keep that AND anytime the word "person" or "WebEx" is used for the font to be RED and "Dispo" to be BLUE. 

When I do Status Color = SWITCH('Legal Files'[Description_1], "Dispo",1, "Letter Waived",2, "Person",3, "WebEx",4)

This doesn't work because there is other text in the column so it's not exactly just the words being used.

How else can I get the text to change color when the column contains those words?

  • Color =
    VAR col = SWITCH(TRUE(),CONTAINSSTRING(SELECTEDVALUE('Legal Files'[Description_1]),"Letter Waived") || CONTAINSSTRING(SELECTEDVALUE('Legal Files'[Description_1]),"Dispo"),"Blue", CONTAINSSTRING(SELECTEDVALUE('Legal Files'[Description_1]),"Person") || CONTAINSSTRING(SELECTEDVALUE('Legal Files'[Description_1]),"WebEx"),"Red")
    RETURN
    col

24 Replies

    • inglexjc's avatar
      inglexjc
      Post Patron

      Padycosmos this does not help.  Watching the video it has to do with numbers and doesn't translate to text.  Also in the video the numbes are not in the same Column they are in differnt rows.

       

      I need color coding for TEXT in the same Column.

      • Padycosmos's avatar
        Padycosmos
        Solution Sage

        I understand. Please try changing the format style to Field Value as shown below

         

  • In power query, select the description column, create a new column by example, type out the required word in two or three rows, the required words automatically get filled in. You can use the new column in the SWITCH() condition

    • inglexjc's avatar
      inglexjc
      Post Patron

      I'm thinking this isn't going to work.

       

      Error even when I tried Letter Waived instead of LW. (in the raw data it comes over as LW.

      I'll have to try something different.