Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

How to display Total Time/Duration in a matrix

Hello, 


Currently I want to show duration in a matrix in Power BI Desktop. I have accomplished to show duration as time in the matrix, which suffice.

 

However the totals in the matrix are not correct yet. It seems that Power BI takes the lowest time/duration value as the total, instead of the sum of time/duration.

 

Besides the time is displayed in hours:minutes:seconds and I want as total the amount of time that has cost an activity to complete.

 

 

 

4 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous ,

     

    Since there isn't a data type like Duration, we can't add the time directly for now. For example, 100:23:50 is a duration format rather than a time format. There is a workaround. Please refer to Addition-of-time-in-a-day.

     

     

    Best Regards,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello v-jiascu-msft ,

       

      Thanks for the help so far!

       

      I have accomplished to use your DAX-Code and insert DAX language for showing the days.

       

      However my Code won't work, because of the days I think.

      If I use "... return days & "." & hours & ":" & minutes & ":" & seconds)", I get a note that the visualization won't open. And if I use "... return days & " " & hours & "" & minutes & "" & seconds)", the visualization will show, but I get a decimal number. 

       

      So my question is what I should do if I want to show the duration of an activity. When an activity has cost several days and I want to show days.hours:minutes:seconds.

       

      I hope you can help me and again thanks for the help so far. Besides my apologies for my English, I'm not a native speaker:smileyvery-happy:.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello v-jiascu-msft  ,

       

      Thanks for the help so far!

       

      I have accomplished to use the DAX-Code out of "Addition-of-time-in-a-day. " and insert DAX language for showing the days.

       

      However my Code won't work, because of the days I think.

      If I use "... return days & "." & hours & ":" & minutes & ":" & seconds)", I get a note that the visualization won't open. And if I use "... return days & " " & hours & "" & minutes & "" & seconds)", the visualization will show, but I get a decimal number. 

       

      So my question is what I should do if I want to show the duration of an activity. When an activity has cost several days and I want to show days.hours:minutes:seconds.

       

      Besides my apologies for my English, I am not a native speaker.

      • v-jiascu-msft's avatar
        v-jiascu-msft
        Icon for Microsoft Employee rankMicrosoft Employee

        Hi Anonymous ,

         

        Can you share some snapshots or the file, please? Please mask the sensitive parts first.

        Which visual did you add it to? I'm afraid it can't work in some visuals because it's a TEXT format value.

         

        Best Regards,