Forum Discussion
Login:Action Completed Ratio Help
- 6 years ago
Anonymous unsure of what you mean? I am assuming you are referring to this column?
TasksCompleted = VAR __User = [UserID] RETURN COUNTROWS( FILTER( ALL('Table2'), 'Table2'[UserID] = __User && 'Table2'[DateTimeCompleted] >= [DateTime] && 'Table2'[DateTimeCompleted] <= [LogoutTime] ) ) - Anonymous6 years ago
I was able to figure it out, I believe, by using EARLIER ! Greg_Deckler
Greg_Deckler this was incredibly helpful, I just learned that not all logins have a logout - so if I wanted to add to this and say also look at login time and any action completed that happened before the next login (or, if easier, any action completed within 4 hours of the login) -- how would I update your formula? Thank you, thank you, thank you!!
Awesome. OK, well. Hmm...
Perhaps something like:
LogoutTime =
VAR __Logout =
IF(
[Action] = "Login",
MINX(FILTER('Table',[DateTime] > EARLIER([DateTime]) && [UserID] = EARLIER([UserID]) && [Action] = "Logout"),[DateTime]),
BLANK()
)
VAR __NextLogin =
IF(
[Action] = "Login",
MINX(FILTER('Table',[DateTime] > EARLIER([DateTime]) && [UserID] = EARLIER([UserID]) && [Action] = "Login"),[DateTime]),
BLANK()
)
RETURN
SWITCH(TRUE(),
NOT(ISBLANK(__Logout)),__Logout,
__NextLogin
)
- Anonymous6 years agoNot applicable
Hrm Greg_Deckler - changing to this formula for some reason made the tasks completed formula start agregating all the activities completing instead of counting the completions between each time frame on a separate line item
- Anonymous6 years agoNot applicable
Greg_Deckler I think because now the logout time is the same time as the next login time - can you help me adjust that logout time to be a bit earlier?
- Greg_Deckler6 years ago
Community Champion
Anonymous Can I get an expanded data set that shows the problem? Currently I do not have an example of what is being discussed.