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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Need solution to calculate Days Late in Excel Query Editor

I have a data source where I need to add a new column to display a calculated value of how many days late an action is past the due date, but if not late, then to display nothing.  Any ideas?

Example of existing column:

 

Contract Due Date

11/30/2019

3/30/2019

11/30/2018

1/19/2019

1/19/2018

 

I need to add a column that would show:

 

Days Late

0 or null

0 or null

19 (calculated as Today (12/19) minus 11/30)

0 or null

334 (calculated as Today (12/19 minus 1/19)

 

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

something like this

Days Late = MAX(TODAY()-Table[Contract Due Date],0)

if it's not overdue the TODAY() - Table[Contract Due Date] will return a negative number, which is always less than 0, If it will be overdue the number will be positive returning the correct value



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

1 REPLY 1
Stachu
Community Champion
Community Champion

something like this

Days Late = MAX(TODAY()-Table[Contract Due Date],0)

if it's not overdue the TODAY() - Table[Contract Due Date] will return a negative number, which is always less than 0, If it will be overdue the number will be positive returning the correct value



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.