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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
littlepatos
Helper II
Helper II

Calculate Time Data into Hours & Minutes using SUM

I am trying to show SUM of total hours for each activity

Hours & Minutes column can't be set as TIME so unsure how to show visual with aggregate SUM

 

littlepatos_0-1675482730155.png

TimeHours & MinutesMinutesMinjutes as ValuesTime Spent

0:05:3200:05055Over 40
1:00:1801:006060Over 40
0:25:4200:252561Over 40
1:00:1201:006062Over 40
0:51:0500:515163Over 40
0:22:5000:222264Over 40

 

I can make it work using Minutes column but I want to see visual in Hours & Minutes

littlepatos_1-1675482818064.png

 

 

2 ACCEPTED SOLUTIONS

Yes.  Multiply the duration by 24, that will give you the hours with fractions.

View solution in original post

Depends on how you get the original duration. Remember that you cannot create columns from measures.

View solution in original post

7 REPLIES 7
ppm1
Solution Sage
Solution Sage

Please see this article for how to handle durations. It shows how to keep them stored as decimals (for aggregations, visuals, etc.) but display as you want with FORMAT as needed (e.g., in a tooltip).

Calculate and Format Durations in DAX – Hoosier BI

 

Pat

 

Microsoft Employee
lbendlin
Super User
Super User

but I want to see visual in Hours & Minutes

How would that scale look like?  Hours and fractions, or hours and quarters?  You won't be able to show a mixed scale on the Y axis of a Column chart.

Would it be possible to show as decimals? Eg: 6 and a half hours is 6.5

Yes.  Multiply the duration by 24, that will give you the hours with fractions.

@lbendlin Thanks - I feel I am close but not quite.

Do I do this by adding a new column with 24 then create a Measure to multiply by Duration by the New Column? 

littlepatos_0-1675567190073.png

 

Depends on how you get the original duration. Remember that you cannot create columns from measures.

Thanks @lbendlin this worked 🙂

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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