Forum Discussion

Matt_W2022's avatar
Matt_W2022
Regular Visitor
3 years ago
Solved

Conditional Formatting for blank date based on text from another field

Hi Everyone, 

 

I am trying to highlight the date column red when the date is blank and the status field is "Completed" 

I have been able to create a measure that turns the date field red when status is completed, how do i make this only happen when the date is blank?

 

Color Date MPLA =
VAR Name1 = IF(SELECTEDVALUE('PLP & MPLA Qualification Data'[MPLA Status]) = "Completed", True, False)
RETURN
SWITCH(
TRUE(),
Name1 , "RED")
 
Thanks in advance for any advice.

 

  • [Color Date MPLA] =
    var StatusValue = 
        SELECTEDVALUE( 'PLP & MPLA Qualification Data'[MPLA Status] )
    var DateValue_ =
        SELECTEDVALUE(
            'PLP & MPLA Qualification Data'[MPLA Date],
            // This value makes sure that when many dates are
            // visible in the current context BLANK is not
            // returned as that could change the logic.
            dt"3000-01-01" 
        )
    var ColorCondition = 
        StatusValue = "Completed" && ISBLANK( DateValue_ )
    VAR Color =
        IF( ColorCondition, "red" )
    return
        Color

2 Replies

  • daXtreme's avatar
    daXtreme
    Solution Sage
    [Color Date MPLA] =
    var StatusValue = 
        SELECTEDVALUE( 'PLP & MPLA Qualification Data'[MPLA Status] )
    var DateValue_ =
        SELECTEDVALUE(
            'PLP & MPLA Qualification Data'[MPLA Date],
            // This value makes sure that when many dates are
            // visible in the current context BLANK is not
            // returned as that could change the logic.
            dt"3000-01-01" 
        )
    var ColorCondition = 
        StatusValue = "Completed" && ISBLANK( DateValue_ )
    VAR Color =
        IF( ColorCondition, "red" )
    return
        Color