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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

Reply
JenWilson
Helper II
Helper II

Calculate date difference excluding weekends

Hi, 

I am trying to see the difference in days between when we are expecting to receive a shipment and the date the shipment actually arrives. The calculated column below is showing values correctly for shipments that are received on time (results 0 if dates are a match) or late (example: Expected Date is 04/26/2023 and Received Date is 05/01/2023 result is 3). However, for shipments that are received earlier then the Expected Date, the result is always showing -1. Is there something wrong with the formula below? 

 

Date Difference = CALCULATE(COUNTROWS('Calendar'),FILTER('Calendar',WEEKDAY('Calendar'[Date],2)<6),DATESBETWEEN('Calendar'[Date],'DataTable'[Expected Date],'DataTable'[Received Date]))-1

1 REPLY 1
Idrissshatila
Super User
Super User

Hello @JenWilson ,

 

check this video, it helped me with a similar case.

https://youtu.be/6JA6uy3ZRBA

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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