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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kasiaw29
Resolver II
Resolver II

Calculate working day difference for anything that is early

Hi community,

 

I have a lovely calculated column which works out a difference of working days between dates. 

 

LC Wdays = CALCULATE(
COUNTROWS(DimDate),
DATESBETWEEN(DimDate[Date],'Activity History'[Latest Customer Agreed Dispatch Date],RELATED('Sub Project w Activities'[Actual Start]) -1),
DimDate[workday]=1,
ALL(DimDate))
 
DimDate is my date dimension table. It's working really well for anything that I'd consider late but not for anything that is early. Can anyone share what else I should add? 
 
 
 
 

2020-09-14_12-39-22.jpg

 

3 REPLIES 3
amitchandak
Super User
Super User
Greg_Deckler
Super User
Super User

@kasiaw29 Can you share sample data from your fact table. Example/simulated data is fine.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler @amitchandak 

 

It's a very simple dimdate table. 3 columns= date, weekday number and working day checker.

kasiaw29_0-1600097668877.png

Week Day = WEEKDAY(DimDate[Date].[Date],2)
Working Day = IF(DimDate[Week Day] in {1,2,3,4,5},1,0)
 
Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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