Forum Discussion
bhmiller89
Helper V
7 years agoDateDiff Between Records by Person
I have a Date/Time for each action a person takes, but there are multiple people each with their own actions. How would I find the datediff between each record by person/date? Columns: Date/Time...
- 7 years ago
Hi bhmiller89 ,
I created an sample as your requested, column date/time and clientID:
You can get the datediff using below measure: (you can change the datediff function as Second/Hour/Minute)
Measure = var a = CALCULATE(MIN([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID])) var b = CALCULATE(MAX([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID])) Return DATEDIFF(a,b,DAY)
bhmiller89
Helper V
7 years agov-diye-msft
Community Support
7 years agoHi bhmiller89 ,
I created an sample as your requested, column date/time and clientID:
You can get the datediff using below measure: (you can change the datediff function as Second/Hour/Minute)
Measure = var a = CALCULATE(MIN([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID]))
var b = CALCULATE(MAX([DateTime]),ALLEXCEPT('Table (2)','Table (2)'[ClientID]))
Return
DATEDIFF(a,b,DAY)