Forum Discussion
tjn_1992
4 years agoFrequent Visitor
Calculating time spent in sub status
Hi all, I have a table called "Sub Status" which has three columns: ID, Date_Time, and Sub Status. I would like to create a column in this table which calculates how much time in hours an ID...
- Anonymous4 years ago
Hi tjn_1992 ,
Please create an index column.
index = int(RIGHT('Sub Status'[Sub Status],1))Then create the a column like below:
hours = var next_time = CALCULATE(MIN('Sub Status'[Date_Time]),FILTER('Sub Status','Sub Status'[ID]=EARLIER('Sub Status'[ID])&&'Sub Status'[Date_Time]>EARLIER('Sub Status'[Date_Time]))) return DATEDIFF('Sub Status'[Date_Time],next_time,MINUTE)/60Best Regards,
Jay
NidhiBhusari
Helper IV
4 years agoHi tjn_1992 ,
Do you have any other Date/Time column in your data?
tjn_1992
4 years agoFrequent Visitor
Hi NidhiBhusari ,
In the Sub Status table? No.
I do, however, have a separate Date table which I link to Sub Status.