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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors