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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
MF_BSC
New Member

How to calculate the through put time of a process for partial workdays only

I am trying to create a through put time for a process.   The output I am looking for is the hours in decimal format with one decimal place from the StartDate to FinishDate including partial days however excluding weekends.  I have gotten the report to output DateDiff in hours including partial days in correct format however it includes weekends, I have gotten NetworkDays to work in hours however it rounds up to the complete day.  I have gotten Datediff to list workdays only but not partial days in hours.  Is there a why to get the output in hours for partial workdays only?

MF_BSC_0-1739285836929.png

Lead time DateDIFF in DAX =
 DATEDIFF(Query1[StartDate],Query1[FinishDate],HOUR)+
     (DATEDIFF(Query1[StartDate],Query1[FinishDate],MINUTE)
     -DATEDIFF(Query1[StartDate],Query1[FinishDate],Hour)*60)/60
 vs
Lead time DateDIFF in DAX =
 DATEDIFF(Query1[StartDate],Query1[FinishDate],HOUR)+
     (DATEDIFF(Query1[StartDate],Query1[FinishDate],MINUTE)
     -DATEDIFF(Query1[StartDate],Query1[FinishDate],Hour)*60)/60
 

vs

Lead time Datediff test =
VAR _Datediff=
CALCULATE(
    SUM('Dates_2024'[Weekday]),
    DATESBETWEEN('Dates_2024'[Date],'Query1'[StartDate],'Query1'[FinishDate])
)-1
RETURN
IF(_Datediff<0,0,_Datediff)
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @MF_BSC ,

 

Since you have start dates and end dates, the best approach to address your requirement is to use a disconnected calendar table to calculate the duration flexibly. With the disconnected table, you will be able to address the weekend etc., and time intelligence function in the calendar table.

 

Best regards,

View solution in original post

3 REPLIES 3
DataNinja777
Super User
Super User

Hi @MF_BSC ,

 

Since you have start dates and end dates, the best approach to address your requirement is to use a disconnected calendar table to calculate the duration flexibly. With the disconnected table, you will be able to address the weekend etc., and time intelligence function in the calendar table.

 

Best regards,

I found an you tube video that does just as you described.

Calculated Busines Hours using DAX (Working Hours in Power BI & Power Pivot-Excel) by Power GI

johnt75
Super User
Super User

You could combine the approaches you have tried. First work out the total difference including non-working days, then count the number of working days, multiply that by 24 and take it off the total difference.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

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

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.