cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

calculate working days between two dates in row

Firstly appologies I am really new to power bi. I need to calculate the working days between two date in row.  I have tried using DATEDIFF which works for calendar days but I wish to exclude weekwends

 

Example

DataDump[Date Logged] and DataDump[Date Completed]
 
I have a second dates table that contains a field called 'SHARED Calendar'[is_weekend] which diplays 1 for saturday and sunday and 0 for weekdays.
 
I wish to know if DATEDIFF to calculate working days.
Richard
1 ACCEPTED SOLUTION

Accepted Solutions
Super User I
Super User I

@cottrera 

 

Please check if this article helps

 

http://www.excelnaccess.com/count-only-working-days-between-2-dates/

 

 

Count Business Days =
VAR MyDates =
 ADDCOLUMNS (
 GENERATESERIES ( TableName[StartDate] + 1, TableName[ EndDate] ),
 "Day", WEEKDAY ( [Value], 2 )
 )
RETURN
 COUNTROWS ( FILTER ( mydates, [Day] <= 5 ) )
Regards,
Zubair


View solution in original post

2 REPLIES 2
Super User I
Super User I

@cottrera 

 

Please check if this article helps

 

http://www.excelnaccess.com/count-only-working-days-between-2-dates/

 

 

Count Business Days =
VAR MyDates =
 ADDCOLUMNS (
 GENERATESERIES ( TableName[StartDate] + 1, TableName[ EndDate] ),
 "Day", WEEKDAY ( [Value], 2 )
 )
RETURN
 COUNTROWS ( FILTER ( mydates, [Day] <= 5 ) )
Regards,
Zubair


View solution in original post

Perfect thank you

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors