Forum Discussion

emiec's avatar
emiec
Icon for Microsoft Employee rankMicrosoft Employee
6 years ago
Solved

Help with DAX and Blank

Hi - I wrote the code below to assign an integer-based off L4 date.  For some L4 dates, they are blank.  To deal with blanks, I wrote an ISBLANK statement to return a 0. However, it doesn't.  Just re...
  • v-frfei-msft's avatar
    6 years ago

    Hi emiec ,

     

    Please remove the Format to work on it. If we use Format, it will be text format, then we cannot get excepted result we need.

    Compliance = 
    VAR now =
        DATEVALUE ( NOW () )
    RETURN
        IF (
            ISBLANK ( qryCompliance[L4Date] ),
            0,
            SWITCH (
                TRUE (),
                'qryCompliance'[L4Date] = now, 1,
                'qryCompliance'[L4Date] < now, 1,
                'qryCompliance'[L4Date] > now, 2
            )
        )
    

     

    For more details, please check the pbix as attached.