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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Surya1
Helper I
Helper I

Calculate difference between two date/time values

how can i find the diff bw two date/time columns.

 

col1                                          col2

 

9-4-2018 15:30:00             28-03-2018 21:00:00

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Surya1,

 

In the data view, you can try the formula below.

Column = DATEDIFF([Column1], [Column2],HOUR)

Calculate_difference_between_two_datetime_values

 

Best Regards,

Dale

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

 

 

@Surya1, in the Query Editor, try:

 

duration_calc = DateTime.From([Column2])-DateTime.From([Column1])

 

Returns

 

-11.77083333

 

-11.77083333 corresponds to:

Duration.Days([duration_calc])   =-11
Duration.Hours([duration_calc])  =-18
Duration.Minutes([duration_calc])=-30







Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.