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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
libertus
Frequent Visitor

Transform aggregated hours as Text to Time

Is there a way to transform this Column that holds hours and minutes (stored is text in the Query) to time hours and minutes:

 

00:09

14:30

74:45

23:30

31:15

ertc...

 

Problems arise with the aggegated working hours on a machine that are above 24:00 hours. They will raise an error when you transform to time.

 

All help appreciated, Bert

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@libertus

 

You can only transfrom this text column into a "Duration" type column. Just add a custom column like below:

 

=#duration(0,Number.FromText(List.First(Text.Split([Time],":"))),Number.FromText(List.Last(Text.Split([Time],":"))),0)

55.PNG

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@libertus

 

You can only transfrom this text column into a "Duration" type column. Just add a custom column like below:

 

=#duration(0,Number.FromText(List.First(Text.Split([Time],":"))),Number.FromText(List.Last(Text.Split([Time],":"))),0)

55.PNG

 

Regards,

@v-sihou-msft

 

What an elegant solution, works like a charm 😉

Thanks!!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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