Calculate Elapsed Time in DAX

k602570

New Member
Joined
May 28, 2013
Messages
4
I'm looking for the DAX equivalent to calculate Elapsed time, incorporating both networkdays & Hours of operation. I understand the "networkdays" works around by utilizing calculate and DatesBetween on the Weekend, Holiday dates, but am struggling with a good way to account for the hours of operation.

ElapsedDays = (NETWORKDAYS(A19,B19,Holidays)-1)*($D$2-$C$2)+MOD(B19,1)-MOD(A19,1)
ElapsedHours = ((NETWORKDAYS(A2,B2,Holidays)-1)*($D$2-$C$2)+MOD(B2,1)-MOD(A2,1))*24

[TABLE="width: 500"]
<TBODY>[TR]
[TD]SDT[/TD]
[TD]EDT[/TD]
[TD]WST[/TD]
[TD]WET[/TD]
[TD]ElapsedDays[/TD]
[TD]ElapsedHours[/TD]
[/TR]
[TR]
[TD][TABLE="width: 108"]
<TBODY>[TR]
[TD="align: right"]12/30/2011 10:38:58 AM</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL></COLGROUP>[/TABLE]
[/TD]
[TD]1/5/2012 3:53:57 PM[/TD]
[TD]8:00[/TD]
[TD]17:00[/TD]
[TD]1.34[/TD]
[TD]32.25[/TD]
[/TR]
[TR]
[TD][TABLE="width: 108"]
<TBODY>[TR]
[TD="align: right"]1/18/2011 4:03:44 PM</SPAN>[/TD]
[/TR]
</TBODY><COLGROUP><COL></COLGROUP>[/TABLE]
[/TD]
[TD]1/26/2011 2:29:46 PM[/TD]
[TD]8:00[/TD]
[TD]17:00[/TD]
[TD]2.18[/TD]
[TD]52.43[/TD]
[/TR]
[TR]
[TD]1/18/2011 11:07:00 AM[/TD]
[TD]1/18/2011 11:57:44 AM[/TD]
[TD]8:00[/TD]
[TD]17:00[/TD]
[TD]0.04[/TD]
[TD]0.85[/TD]
[/TR]
</TBODY>[/TABLE]

</SPAN>[TABLE="width: 904"]
<TBODY>[TR]
[TD]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="align: right"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY><COLGROUP><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL></COLGROUP>[/TABLE]
</SPAN>
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,223,952
Messages
6,175,589
Members
452,653
Latest member
craigje92

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top