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
joaoga1
Frequent Visitor

Displaying time (hh:mm:ss) on a chart

Hi everyone, 

 

I'm currently working on a Power BI project and I ran into a problem. I want a bar chart, with different subjects, and for the bars I want a sum of hours worked on each subject (example: I worked 03:30:00 hours on maintenance and a friend worked 01:00:00 hours on maintenance too, so the bar must show a total of 4:30:00 [hh:mm:ss] for the maintenance subject), taking into consideration that I have different types of subjects, how can I do that?

 

Here's an example of what I need (on excel):

 

AESFWERVFW.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And here's what I managed to do (though it's not what I want):

 

wsvqawer.png

2 ACCEPTED SOLUTIONS
Jimmy801
Community Champion
Community Champion

Hello @joaoga1 

 

you can create a new measure that gives you a text format as you need it. But as I think it's not possible to add this as label text, but only as tooltip. Here how the measure could look like (not tested)

Measure = sumx('table', hour('table'[time])) + TRUNC(sumx('table', MINUTE('table'[time]))/60)  & ":" & mod(sumx('table', MINUTE('table'[time])), 60) & ":00"


If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

 

View solution in original post

Hi @joaoga1 ,

Just put the measure in the Tooltip field:

tooltip.png

 

Best Regards,
Community Support Team _ Yingjie Li
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

6 REPLIES 6
mahoneypat
Employee
Employee

I don't think you can do exactly that.  A couple things to consider

1. you could make your chart with a hours value in decimal form as suggested, and then have a second column/measure with the desired format that you use as a Tooltip

 

2. You could do the same as #1 but make a custom bar chart with Charticulator to add a text label that shows your time in desired format permanently (not a hover tooltip).

Can You Say "Charticulator"? - I Knew You Could - Portland Power BI UG - YouTube

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Jimmy801
Community Champion
Community Champion

Hello @joaoga1 

 

Datetime-formats cannot be summed. You have to create a measure like this

TimeValue = sumx('Table', hour('Table'[Hours])) +(sumx('table', MINUTE('Table'[Hours]))/60)  +  +(sumx('table', SECOND('Table'[Hours]))/60/60)

This gives you a digital version of your datetime like 19,5 so you can put it in the gannt. 

Jimmy801_0-1611819331786.png

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

 

Jimmy thanks for the answer, it really helped!

Altough, I need to visualize the amount of hours in the format of (hh:mm:ss) on the chart, is there any way I can do that?

Jimmy801
Community Champion
Community Champion

Hello @joaoga1 

 

you can create a new measure that gives you a text format as you need it. But as I think it's not possible to add this as label text, but only as tooltip. Here how the measure could look like (not tested)

Measure = sumx('table', hour('table'[time])) + TRUNC(sumx('table', MINUTE('table'[time]))/60)  & ":" & mod(sumx('table', MINUTE('table'[time])), 60) & ":00"


If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

 

Thanks again Jimmy, but how do I add it as a tooltip?

Hi @joaoga1 ,

Just put the measure in the Tooltip field:

tooltip.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

Top Solution Authors
Top Kudoed Authors