Forum Discussion
Anonymous
5 years agoNot applicable
Difference between rows based on ascending time
Hi guys I want to calculate differences between volume per ID. I have no possibility to create Index in PQ. So for example I want the yearliest value that day for that ID to be 0, then as per exampl...
amitchandak
Super User
5 years agoAnonymous , Try
A new colum =
var _max = maxx(filter(Table, [Id] = earlier([ID]), [Timestamp at Datetime] <earlier([Timestamp at Datetime] )),[Timestamp at Datetime] )
return
if(isblank(_max), blank(), datediff(_max,[Timestamp at Datetime] , second))
or a new measure
measure =
var _max = maxx(filter(allselected(Table), [Id] = max([ID]), [Timestamp at Datetime] <max([Timestamp at Datetime] )),[Timestamp at Datetime] )
return
if(isblank(_max), blank(), datediff(_max,max([Timestamp at Datetime]) , second))
- Anonymous5 years agoNot applicable