Forum Discussion
How to get the date difference between succeding rows but in different columns
I am new to power bi, appreciate if anyone can assist me, i do not know how to move forward with the following problem
Data table example:
| filename | date start | date completed | duration in days -> date diff of start and completed | gap to the next file in days -> date diff of date completed and date start of next row |
| abcd | 1 jan 2023 | 2 jan 2023 | 1 | 2 |
| abcf | 4 jan 2023 | 9 jan 2023 | 5 | 8 |
| abcg | 17 jan 2023 | 18 jan 2023 | 1 | 2 |
| addd | 20 jan 2023 |
i know how to create the date diff of two columns in the same row (column 4), can someone help me with column 5 please.
Thanks a lot
Botsog , a new column
Next day =
var _max = minx(filter(Table, [Date Start] > earlier([Date Start]) ), [Date Start])
return
datediff([Date completed], _max , day)
Earlier, I should have known Earlier: https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s
2 Replies
- amitchandak
Super User
Botsog , a new column
Next day =
var _max = minx(filter(Table, [Date Start] > earlier([Date Start]) ), [Date Start])
return
datediff([Date completed], _max , day)
Earlier, I should have known Earlier: https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s
- BotsogNew Member
This is exactly what I needed. thanks!