Forum Discussion

Milagros's avatar
Milagros
Helper I
6 years ago
Solved

undefined

Hi, I am tryng to write an if function that will give the number of days between two dates, with some quaifications.   IF DateB is BLANK, then count the days from DateA to today's date IF DateA is...
  • DataZoe's avatar
    6 years ago

    Hi Milagros 

     

    Try this:

    Days Void to Contractor =
    IF (
        ISBLANK ( 'Source data'[Keys to Maintenance Contractor] ),
        DATEDIFF ( 'Source data'[Void Date], TODAY (), DAY ),
        IF (
            'Source data'[Void Date] > 'Source data'[Keys to Maintenance Contractor],
            0,
            DATEDIFF (
                'Source data'[Void Date],
                'Source data'[Keys Returned from Contractor],
                DAY
            )
        )
    )

     

    I used DAX Studio to help figure out where the missing )'s were!