Forum Discussion
Calculating the duration between rows by tagname
vrmntmtt , Create a new column like this and use that
New column =
var _max = maxx(filter(Table, [received_at] <earlier([received_at]) && [Tag] =earlier([Tag]) ),[received_at])
var _val = maxx(filter(Table, [received_at] =_max && [Tag] =earlier([Tag]) ),[value])
return
if(_val =1 && [Value]=1 , datediff(_max,received_at, second), blank())
amitchandak Thank you for your fast treply.
However, the formule gives an error at the underlined text:
New column =
var _max = maxx(filter(Table, [received_at] <earlier([received_at]) && [Tag] =earlier([Tag]) ),[received_at])
var _val = maxx(filter(Table, [received_at] =_max && [Tag] =earlier([Tag]) ),[value])
return
if(_val =1 && [Value]=1 , datediff(_max,received_at, second), blank())
Update:
I was working in the query, not the data format for adding a column (my bad sorry).
But I recieved the following error while adding the column: DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.