Forum Discussion
Flag double events in a data set, based on timing
- 6 years ago
Well, this one was fun! I've created a table to mimic your situation. Note that in this case and per your requirement, only row 5 should be marked.
Table3 - Note row 5 (ID=A)
I've added a calculated column with the following expression:
HasValueLessThan30MinutsAgo = VAR user = Table3[UserID] VAR currentTimeStamp = Table3[TimeStamp] RETURN COUNTROWS(FILTER(ALL(Table3), Table3[UserID] = user && Table3[TimeStamp] > (currentTimeStamp - ((1/2) *(1/24))) && Table3[TimeStamp] < currentTimeStamp))This counts the rows on a filtered version of the whole table, where timestamp is between currentTimestamp en currentTimestamp minus 30 minutes and where the userID is the current UserID. This results in the following:
That should work.
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Well, this one was fun! I've created a table to mimic your situation. Note that in this case and per your requirement, only row 5 should be marked.
Table3 - Note row 5 (ID=A)
I've added a calculated column with the following expression:
HasValueLessThan30MinutsAgo =
VAR user = Table3[UserID]
VAR currentTimeStamp = Table3[TimeStamp]
RETURN
COUNTROWS(FILTER(ALL(Table3), Table3[UserID] = user && Table3[TimeStamp] > (currentTimeStamp - ((1/2) *(1/24))) && Table3[TimeStamp] < currentTimeStamp))
This counts the rows on a filtered version of the whole table, where timestamp is between currentTimestamp en currentTimestamp minus 30 minutes and where the userID is the current UserID. This results in the following:
That should work.
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
A true wizard indeed, thanks Djerro!
I'm not even going to try to understand the full formula, but the results prove it works in my data set.
Much appreciated!