Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How much time did an user logged in?

Hello guys,   Supposed I have the following data of users, each time they logged in and logged out: User    LoggingType   Date  1         In                     2018-10-05 13:18:26.900 1        ...
  • v-danhe-msft's avatar
    7 years ago

    Hi Anonymous ,

    Based on my test, you could refer to below steps:

    Add index for your data in query editor:

    Apply it and create below formula:

    Column = var a=[Index]-1
    return CALCULATE(MAX(Table1[Date]),FILTER('Table1','Table1'[Index]=a))

    Result:

    Now you could use the [Date] column to minus the [Column].

     

    Regards,

    Daniel He