Forum Discussion
SOS4
4 years agoFrequent Visitor
Date and Time diff from two tables
Hi, I want to track how long it takes users to respond to work 'tickets'. I have two dates from two related tables. Work details open date - work requests open date But I can't figure out h...
- Anonymous3 years ago
Hi SOS4 ,
Here are the steps you can follow:
1. Create calculated column.
Duration HH:MM:SS = var _maxdate=MAXX(ALL('WorkRequests'),'WorkRequests'[DateEntered]) var _all= SUMX(FILTER(ALL('Work Details'),'Work Details'[LCLEnterDate]=EARLIER('Work Details'[LCLEnterDate])), 'Work Details'[LCLEnterDate] - _maxdate) * 1 var _days=INT(_all) var _time=_all-_days return FORMAT( _days, "#0D-" ) & FORMAT( _time, "hh:mm:ss")2. Result:
If you need pbix, please click here.
Date and Time diff from two tables.pbix
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
amitchandak
4 years agoSuper User
SOS4 , The tables need to have some common id table like work order id then you can have
sumx(Values(WorkOrder[Work Order ID]) , calculate(Datediff(Min(Table1[Date]), Max(Table2[Date]), Day) ) )
SOS4
4 years agoFrequent Visitor
Actually I was mistaken, The tables do not have unique values in common, though they are both connected to a third table.
Could this work?