Forum Discussion

henrys1995's avatar
henrys1995
Regular Visitor
4 years ago
Solved

Apply conditional formatting to blank values

 

Hi all,

 

I want to apply conditional formatting to blank values in a matrix.

 

"AcitivityDurationHrs" is in a matrix and I have set up conditional formatting based on field value "ReportingBackgroundColor"

 

However it only applies colours where there is a value in "ActivityDurationHrs".

 

How am I able to do this?

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi henrys1995 ,

     

    If you do not want to hardcode the color as amitchandak mentioned, 

     

    Below are my workarounds.

    1. Apply the following measure to Values field in Matrix as well:

    Measure = MAX('Table'[ReportingBackgroundColor])

     Please see the details:

     

    2. Apply Font color as well as Background color:

    Sum Hrs = SUM('Table'[AcitivityDurationHrs])+0
    Font Color = IF([Sum Hrs]=0,MAX('Table'[ReportingBackgroundColor]),"Black")

     

     

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

3 Replies

  • henrys1995 , Only in Gradient conditional formatting, you have an option. For the  Field Value, You have to try by adding +0 to the measure and returning a color for 0 value

     

    Switch(True() ,

    [Measure] = 0, "Red",

    [Measure] < 10, "Yellow",

    "Green'

    )

     

     

    where Measure = sum(Table[Value])+0

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi henrys1995 ,

     

    If you do not want to hardcode the color as amitchandak mentioned, 

     

    Below are my workarounds.

    1. Apply the following measure to Values field in Matrix as well:

    Measure = MAX('Table'[ReportingBackgroundColor])

     Please see the details:

     

    2. Apply Font color as well as Background color:

    Sum Hrs = SUM('Table'[AcitivityDurationHrs])+0
    Font Color = IF([Sum Hrs]=0,MAX('Table'[ReportingBackgroundColor]),"Black")

     

     

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