Difference between Date & Time - with working time or hours of operation- Elapsed time

kF1894

New Member
Joined
Nov 20, 2009
Messages
7
I'd like to request help in converting the following formula to DAX/PowerPivot: =(NETWORKDAYS(B2,A2)-2)*0.375+MOD(A2,1)-"09:00"+"18:00"-MOD(B2,1) it would also be great if you could help me determine how to deal with changes in the hours of operation.
I have also not yet figured out how to determine if the Elapsed time is within parameters; such as <=2:00 Hrs, Any and all help is greatly appreciated.


Start Work DateCreate DateElapsed time
11/24/2014 17:3811/24/2014 17:010:37
10/14/2014 14:5510/14/2014 14:270:28
10/20/2014 7:3210/20/2014 6:470:45
10/22/2014 15:0410/22/2014 14:430:20
10/23/2014 13:2110/23/2014 13:140:07
10/23/2014 14:0510/23/2014 13:300:35
7/8/2014 10:267/2/2014 10:2612:00
7/30/2014 11:177/30/2014 11:170:00
7/28/2014 12:207/28/2014 12:140:06
7/30/2014 6:357/30/2014 6:350:00
11/20/2014 14:0911/20/2014 13:250:44
11/20/2014 13:1011/20/2014 12:220:48
11/20/2014 14:5711/20/2014 14:190:37
11/13/2014 10:5411/10/2014 13:460:08
12/1/2014 7:2211/26/2014 15:3718:45
9/11/2014 8:199/8/2014 7:553:23

<COLGROUP><COL style="WIDTH: 103pt; mso-width-source: userset; mso-width-alt: 4384" span=2 width=137><COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4160" width=130><TBODY>
</TBODY>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Sorry I don't know anything about DAX/Powerpivot but you can certainly simplify that formula a little, which might make it easier to convert. You can get the same results with this formula

=(NETWORKDAYS(B2,A2)-1)*0.375+MOD(A2,1)-MOD(B2,1)

....although neither version will cater for start/end times outside normal hours

I notice that in your example list the third entry down has both times before 09:00 - wouldn't you want the result to be zero in that case?
 
Upvote 0
I might be able to help... if I knew what that did in like... english :)

That said, you will need a Calendar table in your Power Pivot model, to somehow how know about weekdays/weekends -- cuz at least I am *mostly* sure, there isn't something directly comparible to NETWORKDAYS in DAX.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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