Forum Discussion
Anonymous
7 years agoNot applicable
Calculate earliest date/time after change
I have a data set with regular intervals of time stamped (ts) information.
I want to caluclate the earliest ts of a False state that occurs after a True. (Highlighted below)
To achieve this my current thinking is:
Figure out earliest False state ts from a filtered range of ts that's greater than last True ts
I run into issues with DATESBETWEEN complaining of duplicate values in the date field. I need minute graularity in my results as the state can change multiple times with a single date.
Any help much appreciated.
Try this:
Measure 12 = VAR __max = MAXX(FILTER(Table11,[State]=TRUE()),[ts]) VAR __min = MINX(FILTER(Table11,[State]=FALSE() && [ts]>__max),[ts]) RETURN __min
2 Replies
- Greg_Deckler
Community Champion
Try this:
Measure 12 = VAR __max = MAXX(FILTER(Table11,[State]=TRUE()),[ts]) VAR __min = MINX(FILTER(Table11,[State]=FALSE() && [ts]>__max),[ts]) RETURN __min
- AnonymousNot applicable
That works a charm! Thanks