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
cottrera
Post Prodigy
Post Prodigy

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
Zubair_Muhammad
Community Champion
Community Champion

@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

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@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

Please try my custom visuals

Perfect thank you

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.