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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
PChmurzynski
Frequent Visitor

Omitting nulls/blanks in a Conditional Formatting Measure

I have a table visual with a a Date/Time Column which has some null values. I've effectively applied conditional formatting to that visual by utilising a switch measure. The problem is I'm getting "empty" cells formatted to green. I'd like them to be ignored and left without formatting, but the changes I do to the measure don't seem to work.

DateStatus = 
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[dtmAppt])
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(ApptDate), "White",  -- This is the line i added, but it didn't change anything
        ApptDate > TodayDate, "Green",
        ApptDate = TodayDate, "Yellow",
        ApptDate < TodayDate, "Red"
    )
DateStatus = 
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[dtmAppt])
RETURN
    IF(
        ISBLANK(ApptDate),
        BLANK(),  -- I added this and the If statement, but also no effect.
        SWITCH(
            TRUE(),
            ApptDate > TodayDate, "Green",
            ApptDate = TodayDate, "Yellow",
            ApptDate < TodayDate, "Red"
        )
    )

Can you help?
conditional formatting measure.jpg

1 ACCEPTED SOLUTION
PChmurzynski
Frequent Visitor

 I have solved it. It's very emberrassing. The problem was I was refferring to a different column in the measure than I wanted to apply the conditional formatting to. Bothe measures in the question will work just fine as long as we change the column name. The correct Measure looks like this:

 

DateStatus = 
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[RemJobdtmAppt])
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(ApptDate), BLANK(),  -- Leave blank if there is no date
        ApptDate > TodayDate, "Green",
        ApptDate = TodayDate, "Yellow",
        ApptDate < TodayDate, "Red"
    )

 

View solution in original post

6 REPLIES 6
PChmurzynski
Frequent Visitor

 I have solved it. It's very emberrassing. The problem was I was refferring to a different column in the measure than I wanted to apply the conditional formatting to. Bothe measures in the question will work just fine as long as we change the column name. The correct Measure looks like this:

 

DateStatus = 
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[RemJobdtmAppt])
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(ApptDate), BLANK(),  -- Leave blank if there is no date
        ApptDate > TodayDate, "Green",
        ApptDate = TodayDate, "Yellow",
        ApptDate < TodayDate, "Red"
    )

 

PChmurzynski
Frequent Visitor

I did, but with not effect

PChmurzynski_0-1708453844498.png

 

Is it possible for you to share the .pbix file removing any sensible information?





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





When i drag and drop it tells me the file type (.pbix) is not supported. Any other way I can upload a file here?

Try sending me a DM and there I can provide you an e-mail 🙂





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





ray_aramburo
Super User
Super User

Try using a Date field and not a Date/Time Field as input for the MAX value. Your measure works as expected. See example attached.





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.