Forum Discussion

frknklcsln's avatar
frknklcsln
Icon for Helper II rankHelper II
3 years ago

how to apply conditional formatting for text values in a table

Hi,

 

I have a table like below:

 

 

I would like to color format the blank values as red. I know how to do this with numeric values but I couldn't find for the text datatype columns.

 

Thank you.

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    Hi,
    Try using this DAX  for blanks.

    Title =
    VAR Name1 = IF(SELECTEDVALUE('Sheet1'[Column]) = Blank(), True, False)
    RETURN
    SWITCH(
    TRUE(),
    Name1 , "#CD5C5C")
     
    Thanks.
    • frknklcsln's avatar
      frknklcsln
      Icon for Helper II rankHelper II

      Hi Anonymous , thanks for the response.

       

      Is this a measure or a calculated column?

      • frknklcsln's avatar
        frknklcsln
        Icon for Helper II rankHelper II

        Anonymous , second question,

         

        how can I apply this after the dax? can you show me in screenshots?

         

        much appreciated

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi frknklcsln,

    For a selected column--open conditional formatting-- background color--then select field value--apply measure.

     

    Thanks.

    • frknklcsln's avatar
      frknklcsln
      Icon for Helper II rankHelper II

      Thats not working. I cannot select the measure for the What field should we based this on? area.

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  frknklcsln ,

    What format your measure is, only when it is text format, you can choose, if it is integer, you can't put it in.

    Text =
    IF(
    MAX('Table'[ABC])= BLANK(),"yellow","red")

     

    integer =
    IF(
    MAX('Table'[ABC])= BLANK(),1,0)

     

     

    Best Regards,

    Liu Yang

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