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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
smather
Helper III
Helper III

Hours to Days, Hours & Minutes

Hi there

 

I'm looking to do a formula that calculates hours to days, hours and minutes, but it's a little wonky and not quite straight forward.

 

There's are two type of work days - one is 9 hours and the other is 7hrs 30 mins. 

 

Workday Type 1 = 7hrs 30

Workday Type 2 = 9

 

Data looks a little like:

 

NameProjectHoursWorkDay Type
Person 112303:451
Person 185208:002
Person 1N/A00:30N/A
Person 212308:151
Person 274102:502
Person 385203:002

 

So what I'd expect from this would be: 

 

Project 123: (12 Hours) 1 Day, 4 Hours, 30 Mins

Project 741: (2 Hours) 2 Hours

Project 852: (11 Hours) 1 Day, 2 Hours

 

And then, if possible, in another formula, to translate that to decimal days (rounding up/down as needed), so using the examples above, I'd expect: 

 

Project 123: 1.75 (1 full day and roughly about 3/4ths of a day)

Project 741:  0.15 (nearly qtr of a day)

Project 852: 1.15 (I think that's right, my maths isn't the best, sorry)

 

Thank you!!

3 REPLIES 3
amitchandak
Super User
Super User

@smather , First assume you have measure sim of hours

 

Total = sum(Table[Hours])

 

or

Total = sumX(Table, Hour([Time]) + Minute([Time])/60)

 

 

Then you can have the measure

Total Decimal = Quotient([Total ],8) +MoD([Total ],8)/8

 

Total Text= Quotient([Total ],8) & " Days " & MoD([Total ],8)/8 & " Hours"

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Yes, I already have a Sum(Table[hours]) 🙂 

 

Is the 8 in your formula the working day? Because depending on the type of workday, it could either be 7h30m or 9h - could you explain it a little more for me please?

Hi @smather ,

 

You can use SWITCH() to change the denominator where is 8 in that formula.

SWITCH( SELECTEDVALUE( 'Table'[WorkDay Type]),
1, 7.5,
2, 9 )

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.