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
Tinus1905
Helper III
Helper III

Time column to get begin and end

Hi,

 

I have one time column with different times. For example: 12:43:00 and 14:12:00.

I want a second column like this: 

 

Column1   Column2

12:43:00    12-13

14:12:00    14-15


I cant find the formula for this. 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

In Power Query add a custom column

 

This solution works! So please click accept solution and thumbs up button

= Table.AddColumn(#"Changed Type", "Custom", each Text.From( Time.Hour([Time]))
& "-" &
Text.From(Time.Hour([Time])+1))

 

speedramps_0-1698767490126.png

 

View solution in original post

3 REPLIES 3
speedramps
Super User
Super User

You can pad values before 12 with a leading zero like like

= Table.AddColumn(#"Changed Type", "Custom", each Text.PadStart(Text.From(Time.Hour([Time])),2,"0")
& "-" &
Text.PadStart(Text.From(Time.Hour([Time])+1),2,"0"))

 

speedramps_0-1698768674001.png

 

Ahmedx
Super User
Super User

try this

Screenshot_1.png

speedramps
Super User
Super User

In Power Query add a custom column

 

This solution works! So please click accept solution and thumbs up button

= Table.AddColumn(#"Changed Type", "Custom", each Text.From( Time.Hour([Time]))
& "-" &
Text.From(Time.Hour([Time])+1))

 

speedramps_0-1698767490126.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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