Forum Discussion

CindyChu's avatar
CindyChu
New Member
4 years ago
Solved

Compare completion date with target date and today's date

I need compare completion date with Target date for 'Pass' or 'Fail', but at the meantime if the completion date is blank, and target date is passed today's date, which means the job is definatilty a...
  • BA_Pete's avatar
    4 years ago

    Hi CindyChu ,

     

    Try this in a new custom column:

    let
      Date.Today = Date.From(DateTime.LocalNow())
    in
    if [Completion date] = null and [Target date] < Date.Today then "Fail"
    else if [Completion date] = null and [Target date] >= Date.Today then "In Progress"
    else if [Completion date] > [Target date] then "Fail"
    else "Pass"

     

    Pete