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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
nathanisaacson
Frequent Visitor

Creating a 'Days Past Due' Column

Hi everyone,

 

I have a date column (due date) and I want to create two additional columns:

 

  1. Calculates the number of work days (Mon-Fri) past the due date (assuming it is past due)
  2. Calculates the number of work days (Mon-Fri) until the due date (assuming it is not yet due). 

 

Here is an example below (assuming the current date is 10/31/23)...

 

Due DateWork Days Past DueWork Days Until Due
10/24/235 
10/30/231 
10/31/2300
11/1/23 1
11/7/23 5

 

What is the best way to create the "Work Days Past Due" and "Work Days Until Due" columns?

1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @nathanisaacson ,

 

The following DAX might work for you:

Work Days Past Due = 
VAR Currentday = TODAY()
RETURN
    IF('Table'[Due Date] > Currentday,
    NETWORKDAYS(Currentday, 'Table'[Due Date], 1), BLANK())
Work Days Until Due = 
VAR Currentday = TODAY()
RETURN
    IF('Table'[Due Date] < Currentday,
    NETWORKDAYS('Table'[Due Date], Currentday, 1), BLANK())

I will show you when is it today by using this DAX:

Currentday = TODAY()

 

And the final output is shown in the following figure:

vjunyantmsft_0-1698808438056.png

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

5 REPLIES 5
v-junyant-msft
Community Support
Community Support

Hi @nathanisaacson ,

 

The following DAX might work for you:

Work Days Past Due = 
VAR Currentday = TODAY()
RETURN
    IF('Table'[Due Date] > Currentday,
    NETWORKDAYS(Currentday, 'Table'[Due Date], 1), BLANK())
Work Days Until Due = 
VAR Currentday = TODAY()
RETURN
    IF('Table'[Due Date] < Currentday,
    NETWORKDAYS('Table'[Due Date], Currentday, 1), BLANK())

I will show you when is it today by using this DAX:

Currentday = TODAY()

 

And the final output is shown in the following figure:

vjunyantmsft_0-1698808438056.png

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

This worked perfectly, thank you so much!

Oh, sorry I got the names of the two calculated columns reversed, but the functionality is normal.

JorgePinho
Solution Sage
Solution Sage

Hi @JorgePinho ,

 

Thanks for the quick response!  I don't think that's exactly what I'm looking for.  I don't have a static end date - my end date is technically the current date (which would adjust automatically everyday, ideally).

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.