Forum Discussion

jibran's avatar
jibran
Helper II
9 years ago
Solved

IF statement not working

Hi All, I am struggling to make work IF statement.  I want to use IF statement where the value equals to the some value then show me the date value, else NULL value.   Example Ext End Contract = ...
  • v-haibl-msft's avatar
    v-haibl-msft
    9 years ago

    jibran

     

    Please try with following formula.

     

    Example Ext End Contract =
    IF (
        'Extended Contract'[VEHICLESTATUS] = "Extended Contract",
        FORMAT (
            CALCULATE (
                LASTDATE ( 'Extended Contract'[Ext End Contract] ),
                ALLEXCEPT (
                    'Extended Contract',
                    'Extended Contract'[CUSTOMERNAME],
                    'Extended Contract'[REGISTRATIONNO],
                    'Extended Contract'[Fleetware Contract ID]
                )
            ),
            ""
        ),
        "Jibran"
    )
    

     

    Best Regards,
    Herbert