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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
i820017
Resolver II
Resolver II

Time Subtractions

I am trying to do a time subraction as a calculated column.

For example, the highlighted row should have hours = 8.5 (6:30 pm - 10:00 am) 

i820017_0-1651006441783.png

 

Can this be done as a column or do I have to use a measure?

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=(Table1[End_Date_Repeat]-Table1[Event_Date_Repeat])*24

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=(Table1[End_Date_Repeat]-Table1[Event_Date_Repeat])*24

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This worked...thanks!!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
tackytechtom
Super User
Super User

Hi @i820017 ,

 

Here a solution with a measure:

tomfox_1-1651007636079.png

 

DAX:

DurationMeasure = 
SUMX (Table,  DATEDIFF ( Table[Event_Date_Repeat], Table[End_Date_Repeat], MINUTE ) / 60 )

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/ 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

This solution worked as well, but I wanted the solution as a calculated column. 

tackytechtom
Super User
Super User

Hi @i820017 ,

 

Here a solution for a calculated column:

tomfox_0-1651007378362.png

 

DAX:

DurationCol = 
DATEDIFF ( Table[Event_Date_Repeat], Table[End_Date_Repeat], MINUTE ) / 60

 

Does this solve your issue? 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.