Forum Discussion
Elapsed Time Between Two Dates With Different Rows showing muliplte key values
Good morning,
I need to calculate the elapsed time between two dates that is found on two separate rows. Each row has an ID column that will tie the two rows together as well as task names that will be used to find the start and stop time.
Each order number will appear twice, once for each wire task that is being completed. I need to find the elapsed time, excluding weekends, from the start of the initial wire task (task requested date) to the completion of the wire approval task (task received date
I researched what I could and based on what I found, this seemed like the best approach but still getting an error.
5 Replies
- AnonymousNot applicable
You can refer to 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] ) ), [TaskRequestedDate] ) 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.
- Nicky_The_KnowsFrequent Visitor
Morning Yolo
I tried the solution above but it showing the same value for all rows. It looks like it is grabbing the first start time of the first order number and the stop time of the last order number and then applying that to all orders in the model.
- AnonymousNot applicable
Can you provide some more sample data and the output you want?
Best Regards!
Yolo Zhu