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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 4
v-jiascu-msft
Employee
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,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.

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,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 speakerSmiley Very Happy.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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