Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Anonymous
Not applicable

Show time between the Two Dates

Hi All,

 

I am having one requirement where I need to get the time between two dates. Please find the below sample data. Where I have one column which is "Start Date".

 

     Time.PNG

Let's say we have 24 hours in a day and if we split those 24 hours by 4 hours then 24 hours will be divided 6 times. So in my requirement, for the first start date which is "1-09-2020 12:05:10Am" If I add 4 hours to this date and Time then it should show 

"1-09-2020 04:05:10AM". Please find the below screen shot for the reference of ouput.

Output.PNG

So here I want to calculate the difference between dates but before that I need to have After Adding 4 hours Column in my table . If I have that column then we can find the diffrence between the start date and The column which will get "after adding 4 hours".

Could anyone help me, How can I get the "After adding 4 hours column" ?

 

Best Regards,

Srihari

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

Just add a new calculate column as below:

After Adding 4 hours = 'Table'[Start Date] + TIME(4,0,0)

Result:

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

Just add a new calculate column as below:

After Adding 4 hours = 'Table'[Start Date] + TIME(4,0,0)

Result:

1.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mahoneypat
Microsoft Employee
Microsoft Employee

You can add the TIME function to add 4 hrs in either a calculated column or (recommended) in a measure like this one.  Use this in a table visual with your start date column, replacing AddTime with your actual table name.

 

Plus 4 hrs = MIN(AddTime[Start Date]) + TIME(4,0,0)
 
Regards,
Pat
 




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.