Forum Discussion

Adam01's avatar
Adam01
Advocate I
4 years ago
Solved

Calculating Date Diff based on blank columns

Hello everyone, I have a bit of an odd one today   I am trying to create a custom column that calculates that date diff between todays date and EITHER the "Ideal Due Date" Column OR the "Fixed Dead...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi,

     

    Try the below solution

     

    Days until Deadline = 
    
    -- Returns true if both columns are blank
    var CheckBlanks = ISBLANK('Table'[Ideal Due Date]) && ISBLANK('Table'[Fixed Deadline]) 
    
    -- Returns the difference prioritising Fixed Deadline column
    var DaysDiff = int(TODAY() - COALESCE('Table'[Fixed Deadline], 'Table'[Ideal Due Date]))
    
    return if(CheckBlanks, "No Deadlines set", CONVERT(DaysDiff, STRING))