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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
TomBrown
Frequent Visitor

Calculating time that has more than 24 hours in a format (h):mm:ss

hello everyone
let me begin by saying I'm very new both to BI and DAX (my first BI experience)

will trying to calculate the duration of the time worked on a case
I have two columns 1. Opened (case date & time) 2. resolved (case closed date & time)
I would like to create a column that sum their values and will show my how much time has passed between them, in a format that can show more than 24 hours (523:36:54)

is it possible?

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi  @TomBrown ,

 

You can create columns like DAX below.

 

Seconds = DATEDIFF(Table1[Opened],Table1[resolved],SECOND)

 

(h):mm:ss =

var Hour=QUOTIENT(Table1[Seconds],3600)

var Minute=QUOTIENT(Table1[Seconds]-Hour*3600,60)

var Second=Table1[Seconds]-Hour*3600-Minute*60

return

CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE(Hour,":"),Minute),":"),Second)

 

7.png

 

 

 

Best Regards,

Amy

 

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-xicai
Community Support
Community Support

Hi  @TomBrown ,

 

You can create columns like DAX below.

 

Seconds = DATEDIFF(Table1[Opened],Table1[resolved],SECOND)

 

(h):mm:ss =

var Hour=QUOTIENT(Table1[Seconds],3600)

var Minute=QUOTIENT(Table1[Seconds]-Hour*3600,60)

var Second=Table1[Seconds]-Hour*3600-Minute*60

return

CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE(Hour,":"),Minute),":"),Second)

 

7.png

 

 

 

Best Regards,

Amy

 

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

Thank you very much Smiley Very Happy

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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