Display time over 24 hours in Power BI

ChloeSpurge

New Member
Joined
May 5, 2021
Messages
25
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I have this pivot table in excel which sums weekly hours, then I've formatted it as [hh]:mm due to the sum being over 24 hours.

1645530167692.png


However when I import this table into power BI it will not let me change the time to be over 24 hours, matching the table above. Any ideas how I could makes the times correct (matching table above)? Maybe convert the decimal to a time?
1645530338881.png
1645530442401.png
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I'm a bit confused here about your number formats. Take week 24 for instance. Which is one correct: 145320 hrs 41 mins or 6055 hrs 41 mins? Or are they just using different data?

Anyways, greater than 24hr time formats are not something PBI can handle on its own. Assuming the units in your Sum of Weekly Hours column is actually number of hours, you could kind of make your own in a new column. This new column will technically be a text column, so you could not apply numerical operations against it, but that's what the original decimal column is for.
Code:
new column = TRUNC([sum of weekly hours]) & ":" & FORMAT(([sum of weekly hours]-TRUNC([sum of weekly hours]))*60,"00")
1645552902650.png
 
Upvote 0
I'm a bit confused here about your number formats. Take week 24 for instance. Which is one correct: 145320 hrs 41 mins or 6055 hrs 41 mins? Or are they just using different data?

Anyways, greater than 24hr time formats are not something PBI can handle on its own. Assuming the units in your Sum of Weekly Hours column is actually number of hours, you could kind of make your own in a new column. This new column will technically be a text column, so you could not apply numerical operations against it, but that's what the original decimal column is for.
Code:
new column = TRUNC([sum of weekly hours]) & ":" & FORMAT(([sum of weekly hours]-TRUNC([sum of weekly hours]))*60,"00")
View attachment 58479
Hi, sorry I should have specified, below is the the format power BI turns the data into when it is imported, this is the decimal version of 145320:41, 144277:56 etc. durations. Maybe there's a way to turn the decimal number into a time format? matching 145320:41, 144277:56 etc.
1645606581641.png

Many thanks :)
 
Upvote 0
Load the column as a Duration type, then you can use something like:

Power Query:
=Number.ToText(Number.RoundDown(Duration.TotalHours([HoursColumn]),0))&":"&Number.ToText(Number.RoundDown(Duration.Minutes([HoursColumn]),0))

where HoursColumn is the name of your duration column.
 
Upvote 0
Load the column as a Duration type, then you can use something like:

Power Query:
=Number.ToText(Number.RoundDown(Duration.TotalHours([HoursColumn]),0))&":"&Number.ToText(Number.RoundDown(Duration.Minutes([HoursColumn]),0))

where HoursColumn is the name of your duration column.
Hi, thanks for the reply, I've tried this as a measure and new column but both have this issue pop up, any ideas?
1645619120393.png

1645619208557.png
 
Upvote 0
What version of PowerBI are you using? You'd do it in the Power Query editor, not as a measure.
 
Upvote 0
What version of PowerBI are you using? You'd do it in the Power Query editor, not as a measure.
I've got this version, I don't think its the pro version. How would I use this formula/code in the power query editor?

1645619769595.png

Many thanks :)
 
Upvote 0
Mine is 2.99.621.0 (Nov 21)

Add a new custom column and paste that formula in.

1645620271896.png
 
Upvote 0

Forum statistics

Threads
1,223,669
Messages
6,173,700
Members
452,527
Latest member
ineedexcelhelptoday

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top