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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.