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
AnkitaaMishra
Super User
Super User

Conditional Formatting in Table Visual when the data is missing

Hi All, 
I am facing a challenge with conditional formatting when the row is not present in the table.
Table : 

IDDateParameterVALUEAC_TargetDM_Target
2029003-07-2021 00:00DM88.7Off TargetOn Target
2029003-07-2021 00:00AC98.8On TargetOff Target
2176905-07-2022 00:00DM87.2Off TargetOn Target
2176905-07-2022 00:00AC100On TargetOff Target
2177908-07-2022 00:00DM76.3Off TargetOff Target
2177908-07-2022 00:00AC100On TargetOff Target
2250308-01-2023 00:00DM90.4Off TargetOn Target
2250308-01-2023 00:00AC94On TargetOff Target
2404212-08-2023 00:00AC98On TargetOff Target
2627810-09-2024 00:00AC100On TargetOff Target


In the above table, AC_Target and DM_Target are the calculated columns with below DAX :

DM_Target = IF(ExampleProblem[Parameter]="DM" && ExampleProblem[VALUE]>=85, "On Target", "Off Target")
AC_Target = IF(ExampleProblem[Parameter]="AC" && ExampleProblem[VALUE]>=90, "On Target", "Off Target")

For conditional formatting I am using below Measure : 
ConditionFormatting =
VAR _Target = MAX(ExampleProblem[DM_Target])
VAR _ColorLogic =
SWITCH(TRUE(),
_Target="On Target", "#4BA02C",
_Target="Off Target", "#DD5051","#FFFFFF")
RETURN
_ColorLogic

Now below is the output : 

WhatsApp Image 2024-12-17 at 13.39.16.jpeg

What I want to do is wherever it is coming blank I need White background instead of Red from above screenshot. 
Logic wise actually where the blank is coming those rows are not present in source, hence its tagging as Off Target and then coming Red.

Request for your help here.

Thanks, 
Ankita


1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @AnkitaaMishra 

 

You can modify your condition for DM and AC target

 

DM_Target2 = IF('Table target'[Parameter]="DM" && 'Table target'[VALUE]>=85, "On Target", if('Table target'[Parameter]="DM" && 'Table target'[VALUE]<85,"Off Target", BLANK()))
 
Uzi2019_0-1734424148444.png

I hope this is what you are looking for.

Uzi2019_1-1734424351392.png

 

 

I hope I answered your question!

 

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
AnkitaaMishra
Super User
Super User

Thanks for quick response @Uzi2019 , I had multiple AND conditions for the Target column but implemented the same logic suggested by you for both >= and < and it worked perfectly. 🙂

Uzi2019
Super User
Super User

Hi @AnkitaaMishra 

 

You can modify your condition for DM and AC target

 

DM_Target2 = IF('Table target'[Parameter]="DM" && 'Table target'[VALUE]>=85, "On Target", if('Table target'[Parameter]="DM" && 'Table target'[VALUE]<85,"Off Target", BLANK()))
 
Uzi2019_0-1734424148444.png

I hope this is what you are looking for.

Uzi2019_1-1734424351392.png

 

 

I hope I answered your question!

 

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi @AnkitaaMishra 

 

create similar coumn for AC target.

 

your conditional formatting logic was correct just that you calculated column for DM and AC target missing one condition for blank(). that why showing off target where condition is not met.

 

I hope you understood my point.

 

I hope above solution would help you to understand and solve your issue!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

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