Forum Discussion
DATEDIFF between Rows and GROUP BY
- 8 years ago
here is the output i see on my end from your data
try this, in query editor, add a index column , then add following measure
Minute Diff = var prevRowDate = CALCULATE(MAX(x[DateTime]), Filter(ALLSELECTED(x), x[Index] < MAX( x[Index]))) return datediff(prevRowDate, max(x[DateTime]), MINUTE)
here is the output i see on my end from your data
- Giavo8 years agoHelper III
Thank you very much, really great job. Would it be possible a new Column instead of a Measure ?
- parry2k8 years agoSuper User
unfortunately not in the same table, we have to create a calculated table.
- Giavo8 years agoHelper III
oh ok, it is ok then. My next step would be to SUM this minutes per each IWC Number
- parry2k8 years agoSuper User
summ of minutes = sumx(x, [Minute Diff])
add above measure, drop table visual with iwc number and above measure, you will have it.
- Menolly8 years agoFrequent Visitor
Hi,
I'll be really interested by how you create this new table from the date column and the measure.
I tried many ways but I'm not satisfied by result.
Thanks
- benario8 years agoNew Member
Kindly help me understand the formula because i keep getting the erro message that the syntax for '[index]' is incorrect. How is the [index] section of the formula supposed to posted ?