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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DATEDIFF without weekends still doesn't work...

Hello everyone,

 

I have read a lot of solutions about how to exlude weekends in a datediff formula, but i did not work for me.

My formula is:

IF([Order uitgewerkt] = "Yes",
IF(
DATEDIFF([Order in],[Engineering ready],DAY)<0,
0,
DATEDIFF([Order in],[Start engineering],DAY)-1),
DATEDIFF([Order in],TODAY(),DAY)-1)

 

in al the three DATEDIFF i need to exlude weekends.

 @amitchandak replied a few days ago with this answer how to solve this: COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(Table[Start Date],Table[End Date]),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1)

but this doesn't work for me because some of my date rows are empty so the formula gives a error that CALENDAR can't be empty and i don't kwow how to solve this

 

I already have a column that says if a day is a workday or a weekend. I tried to put in a filter before the datediff but that doesn't work either.

 

Anyone knows how to solve this? i tried everyting i could for a week now but i can't get the right formula that exclude weekends unfortunately..

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , If you these two columns in one table and you date table with workday(1/0)

A new column =

sumx(filter('Date', 'Date'[Date] >= Table[Start engineering] && 'Date'[Date] >= Table[Engineering ready]),[Work Day])

 

Refer to file below, Where on 2nd page work day diff as measure form 2 tables. But same is true for one able

 

Also discussed it here, if this can help: How to calculate Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.