Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
henrys1995
Regular Visitor

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?

 

 

 

2Capture.PNG1Capture.PNG

1 ACCEPTED SOLUTION
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:

Eyelyn9_1-1658120022586.png

 

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")

Eyelyn9_2-1658120151824.pngEyelyn9_3-1658120170611.png

 

 

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.

View solution in original post

3 REPLIES 3
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:

Eyelyn9_1-1658120022586.png

 

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")

Eyelyn9_2-1658120151824.pngEyelyn9_3-1658120170611.png

 

 

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.

amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  I need the colour for blank to be whatever is stated in "ReportingBackgroundColor"

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.