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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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