Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How would I return the the Completed task as overdue when the update date is after the duedate ?

Hi all   I have used the following DAX to create the ISOverdue Colum , However some of the the Tasks status Completed as highlighted below are returning incorrectly , the Not started tasks are retu...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Please try:

    IsOverdue =
    var __Status = [TaskStatus]
    var __DueDt = [DateDue]
    var __UpdateDt = [UpdateDate]
    return
    IF ( __Status = "Deleted", "No",  //Filter out "Deleted"
        IF ( __DueDt >= TODAY(), "No",  //Filter out future due dates
          IF ( (__DueDt >= __UpdateDt || ISBLANK( __UpdateDt )) && __Status <> "Completed",  //Open item has due date in the past and not completed
              "Yes",
              IF ( __Status = "Completed" && __UpdateDt > __DueDt, "Yes", "No" )  //Completed item is overdue if update date is after due date
          )
        )
    )

    This expression adds an additional condition to check if the task is completed and the update date is after the due date. If this condition is met, the task is considered overdue.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum