Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

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 returning correctly 

 

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

 

 

Thanks in advance

 

Adil

 

 

 

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 ||  //Closed item from the past was overdue when completed
               ISBLANK( __UpdateDt ),  //Open item has due date in the past
          "Yes", "No" )
    )
)

AAH30_1-1689776202195.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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

pankaj_lp
Helper I
Helper I

try using switch instead of if statement and use each case separately.

Washivale
Resolver V
Resolver V

hey @Anonymous : how does this behave when you change your third if condition to following and keep rest as it is?
IF ( __UpdateDt > __DueDt ||  //Closed item from the past was overdue when completed
               ISBLANK( __UpdateDt ),  //Open item has due date in the pas

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors