The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi everyone,
I have a date column (due date) and I want to create two additional columns:
Here is an example below (assuming the current date is 10/31/23)...
Due Date | Work Days Past Due | Work Days Until Due |
10/24/23 | 5 | |
10/30/23 | 1 | |
10/31/23 | 0 | 0 |
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?
Solved! Go to Solution.
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:
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.
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:
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.
Hi @nathanisaacson !
Check this post to see if it helps you: https://community.fabric.microsoft.com/t5/Desktop/Difference-between-dates-considering-only-working-...
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).
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
122 | |
89 | |
75 | |
55 | |
45 |
User | Count |
---|---|
134 | |
120 | |
76 | |
65 | |
64 |