Forum Discussion

paw1's avatar
paw1
Icon for Helper I rankHelper I
3 years ago
Solved

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

7 Replies

    • paw1's avatar
      paw1
      Icon for Helper I rankHelper I

      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

    • paw1's avatar
      paw1
      Icon for Helper I rankHelper I

      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