Forum Discussion
Giavo
Helper III
8 years agoDATEDIFF between Rows and GROUP BY
Hello everybody. 2 DAX Questions about DATEDIFF. 1)I need to find the difference in minutes between the rows of "DateTime" column 2)I need to find the difference in minutes between the rows of "Dat...
- 8 years ago
here is the output i see on my end from your data
parry2k
Super User
8 years agodo you mean difference between row and (row -1), not row + 1
Giavo
Helper III
8 years agoyes you're right. Row and Row - 1
- parry2k8 years ago
Super User
Giavo :manhappy:
Can you paste the data so that i can use that for calc instead of the image you pasted, or share excel file (using google drive or other means). cheers!
- Giavo8 years ago
Helper III
yes sure, thank you for helping
ProgressiveIndex IWC Number DateTime Status 1 100 13/10/17 7:10 1 2 100 13/10/17 9:04 3 3 100 13/10/17 9:10 3 1 103 13/10/17 9:18 2 2 103 14/10/17 9:21 5 3 103 14/10/17 9:31 7 1 106 14/10/17 9:50 31 2 106 14/10/17 10:09 21 3 106 14/10/17 11:02 43 - parry2k8 years ago
Super User
try this, in query editor, add a index column , then add following measure
Minute Diff = var prevRowDate = CALCULATE(MAX(x[DateTime]), Filter(ALLSELECTED(x), x[Index] < MAX( x[Index]))) return datediff(prevRowDate, max(x[DateTime]), MINUTE)