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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
fbittencourt
Advocate II
Advocate II

Skip blank values based on the color condition

 
 My color condition does not excludes the blank values and keep the condition , I have tried this: 
colorMEP= BLANK() && colorProgress = "#E66C37", "000000", but is not working
 
fbittencourt_0-1738062809365.png

 

 
Format cond Nom du projet =
VAR MEP_Planifie = MAX(REF_PROJET[MEP Date])
VAR colorMEP = IF(MEP_Planifie < [Date_jourM-1], "#E66C37", "#000000")
VAR colorProgress = IF([% Avancement projet] > 0.9, "#E66C37", "#000000")
RETURN
SWITCH(
TRUE(),
colorMEP = "#E66C37" && colorProgress = "#E66C37", "#0000FF", // Both conditions are red, set to blue
colorMEP= BLANK() && colorProgress = "#E66C37", "000000",
colorProgress = "#000000", "#000000", // Progress condition is black
"#000000" // Default color
)

two varibles descriptive:
Format cond %avancement ( last column)= IF(
    [% Avancement projet] > 0.9, "#e66c37","#000000")
 
Format cond MEP-Jour font ( first column) =

var MEP_Planifie = Max(REF_PROJET[MEP Date])
var colorchange =
SWITCH(
    TRUE(),
     MEP_Planifie < [Date_jourM-1], "#E66C37","#000000"
   
)
RETURN
colorchange
 
Thank you in advance
 
2 REPLIES 2
rohit1991
Super User
Super User

hi @fbittencourt ,

 

Glad the last version helped a bit! I think the key with Power BI formatting and blanks is to be really explicit with how you handle them, since visuals will ignore BLANK() and just show default formatting.

 

Try this version for your measure, it's a bit cleaner and should skip formatting whenever there’s missing data, plus it keeps your color logic clear:

 

VAR MEP_Planifie = MAX(REF_PROJET[MEP Date])
VAR colorMEP =
    IF(
        ISBLANK(MEP_Planifie),
        BLANK(),
        IF(MEP_Planifie < [Date_jourM-1], "#E66C37", "#000000")
    )
VAR colorProgress =
    IF(
        ISBLANK([% Avancement projet]),
        BLANK(),
        IF([% Avancement projet] > 0.9, "#E66C37", "#000000")
    )

RETURN
SWITCH(
    TRUE(),
    // Skip formatting if either color is blank
    ISBLANK(colorMEP) || ISBLANK(colorProgress), BLANK(),
    // Both conditions orange = blue
    colorMEP = "#E66C37" && colorProgress = "#E66C37", "#0000FF",
    // Otherwise use main color
    NOT(ISBLANK(colorMEP)), colorMEP,
    NOT(ISBLANK(colorProgress)), colorProgress,
    "#000000"
)

 

By checking ISBLANK up front, Power BI will just leave the cell with default formatting if there’s no data, which is usually what you want. Multiple Conditions: If both conditions are met, you’ll get blue; otherwise, your normal rules apply. Still Not Working? Sometimes “blank” in Power BI is actually an empty string or a hidden value, so double-check your source fields if it’s still acting weird (using LEN or TRIM can help diagnose).

 

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Thanks for you quick answer, I have applied your code it looks good concerning the blank values, but I do not know for what reason the issue remains.
Maybe if we change the mesure it works

fbittencourt_1-1738078378712.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.