Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
date/timeHello,
I am having problems calculating the average spacing between dates
Solved! Go to Solution.
Hi,
Please take following steps:
1)Add an index column to the original table in Query Editor.
2)Try this column to combine date and time columns:
Date-Time = 'Table'[Date]+'Table'[Time]
3)Try this calcluated column:
Column =
DATEDIFF (
CALCULATE (
MAX ( 'Table'[Date-Time] ),
FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 )
),
'Table'[Date-Time],
SECOND
)
4)The result shows:
See my attached pbix file.
Best Regards,
Giotto
Hi,
Could you please explain more about your requirement?
You can share your expected result as a screenshot.
Expect your reply!
Best Regards,
Giotto
Hello, @parry2k , @v-gizhi-msft
I want to calculate the date difference (in minutes) between each date in the column shown.
For example:
Date Time Results in seconds
08/04/2020 15:52:20
08/04/2020 15:52:20 0
08/04/2020 15:52:22 2
08/04/2020 15:22:24 2
08/04/2020 15:24:00 96
09/04/2020 15:24:00 86 400 (24 hours in seconds)
09/04/2020 15:24:25 25
09/04/2020 15:25:25 60
09/04/2020 15:29:25 240
09/04/2020 15:29:25 0
Thank you in advance
Best,
Mark
Hi,
Please take following steps:
1)Add an index column to the original table in Query Editor.
2)Try this column to combine date and time columns:
Date-Time = 'Table'[Date]+'Table'[Time]
3)Try this calcluated column:
Column =
DATEDIFF (
CALCULATE (
MAX ( 'Table'[Date-Time] ),
FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 )
),
'Table'[Date-Time],
SECOND
)
4)The result shows:
See my attached pbix file.
Best Regards,
Giotto
@Anonymous not fully clear what you are trying to do here. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |