Forum Discussion
Elapsed Time Between Two Dates With Different Rows showing muliplte key values
Can you provide some more sample data and the output you want?
Best Regards!
Yolo Zhu
Good afternoon,
I have removed the columns from the model that are not applicable and included multiples.
For each order number, there will be two tasks that need to be completed, outgoing wire and outgoing wire approval. I want to capture the time it takes from the beginning of the process (outgoing wire) to the end of the process (outgoing wire approval) for each order.
In the sample below, I have 5 distinct order numbers where I need to capture this value for each order number seperatly. I have included table where the data can be copied as well as an image with highlighted cells showing the order number groups with the start and stop times.
| OrderNumber | TaskName | TaskRequestedDate | TaskReceivedDate |
| 2194703 | HSoA: Outgoing Wire | 10/6/23 8:50 PM | 10/6/23 9:04 PM |
| 2194703 | HSoA: Outgoing Wire Approval | 10/6/23 9:04 PM | 10/6/23 9:54 PM |
| 2196838 | HSoA: Outgoing Wire | 9/29/23 3:22 PM | 9/29/23 3:22 PM |
| 2196838 | HSoA: Outgoing Wire Approval | 9/29/23 6:43 PM | 9/29/23 7:05 PM |
| 2204868 | HSoA: Outgoing Wire | 10/10/23 7:15 PM | 10/10/23 7:15 PM |
| 2204868 | HSoA: Outgoing Wire Approval | 10/10/23 7:15 PM | 10/10/23 7:41 PM |
| 2206811 | HSoA: Outgoing Wire | 9/29/23 12:49 PM | 9/29/23 12:55 PM |
| 2206811 | HSoA: Outgoing Wire Approval | 9/29/23 12:55 PM | 9/29/23 12:55 PM |
| 2207317 | HSoA: Outgoing Wire | 10/4/23 4:20 PM | 10/4/23 4:20 PM |
| 2207317 | HSoA: Outgoing Wire Approval | 10/4/23 4:20 PM | 10/4/23 4:52 PM |
- Anonymous2 years agoNot applicable
Try the following measure
Outgoing Wire Elased Time = var _requ=MINX(FILTER(ALLSELECTED('hsoa cvw_DashboardSSCTasks_HSOA'),[OrderNumber] in VALUES('hsoa cvw_DashboardSSCTasks_HSOA'[OrderNumber])),[TaskRequestedDate]) var _rece=MAXX(FILTER(ALLSELECTED('hsoa cvw_DashboardSSCTasks_HSOA'),[OrderNumber] in VALUES('hsoa cvw_DashboardSSCTasks_HSOA'[OrderNumber])),[TaskReceivedDate]) RETURN DATEDIFF(_requ,_rece,SECOND)Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.