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
paw1
Helper I
Helper I

Total Duration calculation in DAX

Hi,

Please can you help me to calculate Total Duration(Completed-Started) in days hh:mm:sss format aggregated by Department and ID in Dax only. In my reprot Department, ID is coming from one table and Timestamps are coming from another table.

 

 

DepartmentIDCompetedStarted
Clothes20331/01/2023 14:45:1530/01/2023 14:12:15
Clothes20319/12/2022 09:57:5819/12/2022 09:57:30
Electronics20621/12/2022 10:57:5819/12/2022 10:57:58
Electronics20722/12/2022 10:57:5821/12/2022 10:57:58
Electronics20726/12/2022 12:57:5826/12/2022 10:57:58
1 ACCEPTED SOLUTION

7 REPLIES 7
Ahmedx
Super User
Super User

can show what result you expect

Hi .

I am expecting below Total duration as expected output then it need to sum at department and id level

 

DepartmentIDTotal Duration 
Clothes2031 day 00:33:28
Electronics2062 day 00:00:00
Electronics2071 day 02:00:00

 

 

DepartmentIDCompetedStartedTotal Duration 
Clothes20331/01/2023 14:45:1530/01/2023 14:12:151 day 00:33:00
Clothes20319/12/2022 09:57:5819/12/2022 09:57:300 day 00:00:28
Electronics20621/12/2022 10:57:5819/12/2022 10:57:582 day 00:00:00
Electronics20722/12/2022 10:57:5821/12/2022 10:57:581 day 00:00:00
Electronics20726/12/2022 12:57:5826/12/2022 10:57:580 day 02:00:00

Hi Ahmedx,

Thanks for you reply. I need aggregate of Total Duration by Department and ID. For example in above ooutput

 

for Clothes Department Total duration need to show like 1 day 01:33:28 . its sum of two entries in front end table

Idrissshatila
Super User
Super User

Hello @paw1 ,

 

check if this function would help for your case https://learn.microsoft.com/en-us/dax/datediff-function-dax

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




hi Date difference function sytnax contains any one parameter like hour/minute/second. But i am looking for days hh:mm:ss format and also need to aggregate by Department and id

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.