Forum Discussion
Time Between and Avg Time Question
- Anonymous4 years ago
Based on the average of the whole process, you can refer to the following measure.
Total DateDiff = var _mindate=CALCULATE(MIN('Table'[Time In]),ALLEXCEPT('Table','Table'[Hosp_ID],'Table'[Patient_ID])) var _maxdate=CALCULATE(MAX('Table'[Time Out]),ALLEXCEPT('Table','Table'[Hosp_ID],'Table'[Patient_ID])) return DATEDIFF(_mindate,_maxdate,DAY)Based on the average of each hospital for each step, you can refer to the following measure.
average = var _t= SUMMARIZE('Table',[Step_ID],[Patient_ID], [Hosp_ID],"Diff",[Step DateDiff]) return AVERAGEX(FILTER(_t,[Step_ID]=MAX('Table'[Step_ID]) && [Hosp_ID]=MAX('Table'[Hosp_ID])),[Diff])Finally , you will get a result as shown below (The unit is minutes).
I have attached my pbix file , you can refer to it .
Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have a doubt, if I choose GA in hospital slicer , it returns two patients E and F . For E, his time is from 5-02 2:05 pm to 5-17 3:05 pm,the duration is 15 days plus one hour . For F, his time is from 5-04 2:05 pm to 5-17 5:05 pm,the duration is 13 days plus three hours . So for GA, the average is 15 days 1 hour plus 13 days 3 hours, divided by 2 ? The end result is 14 days plus 2 hours?
Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Again:
One potential comparion whould look like the chart below(with a total time elapsed between the start and end, it's also great if can filter by patient too.
I hope this helps explain: