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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Jak27136
Frequent Visitor

Order Date adding on a number of working days to an Order Date

I have a table with a field called "Orderdate" and I would like to X number of working days to this date to give a new date the forecasted delivery date. 

 

Currently I just add a number of days see below  

Due Date 14 = BeauPark_Backorder_Analysis_PowerBI_Export[Order Date]+14

 

However I want to add working days only please note I do not have calendar table 

 

 

2 REPLIES 2
123abc
Community Champion
Community Champion

To add a specific number of working days (business days) to a date in Power BI without using a calendar table, you can create a custom measure using DAX. You can use a loop in the DAX formula to iterate through the days and skip weekends (Saturday and Sunday) while adding working days. Here's an example of how you can do it:

 

Due Date Working Days =
VAR StartDate = BeauPark_Backorder_Analysis_PowerBI_Export[Order Date]
VAR WorkingDaysToAdd = 14 // Change this to the number of working days you want to add
VAR CurrentDate = StartDate
VAR DaysToAdd = 0

WHILE (DaysToAdd < WorkingDaysToAdd)
IF (WEEKDAY(CurrentDate, 2) <> 6 && WEEKDAY(CurrentDate, 2) <> 7)
// Check if CurrentDate is not Saturday (6) or Sunday (7)
SET CurrentDate = CurrentDate + 1
SET DaysToAdd = DaysToAdd + 1
ELSE
SET CurrentDate = CurrentDate + 1 // Move to the next day
END IF
END WHILE

RETURN CurrentDate

 

In this DAX measure:

  • StartDate is the initial order date.
  • WorkingDaysToAdd is the number of working days you want to add (in your example, it's set to 14).
  • CurrentDate is a variable used to keep track of the current date being evaluated.
  • DaysToAdd is a variable used to count the working days added.

The WHILE loop iterates through each day, checking if it's a Saturday (6) or Sunday (7) and only adds to DaysToAdd if it's a working day (not Saturday or Sunday). It continues until DaysToAdd reaches the desired number of working days.

You can then use this "Due Date Working Days" measure in your visuals to calculate the forecasted delivery date based on working days.

Hi  and many thanks for your reply however i get the following when i copy this into my model and I am not sure how to resolve. 

 

Jim  

 

Jak27136_0-1694777053064.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors