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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Frixel
Post Prodigy
Post Prodigy

convert Timestamp to two colomns with date & time

Hi all,

 

I have this Timestamp (23-06-2020 09:12:22) also with ( )

Can i convert this in one step to a colomn with date and a colomn with time?

This noob have looking for a how to but couldn`t find it.

2 ACCEPTED SOLUTIONS
az38
Community Champion
Community Champion

Hi @Frixel 

try

 

Date Column = DATEVALUE(MID([Timestamp Column], 2, 10))

 

and

 

Time Column = TIMEVALUE(MID([Timestamp Column], 13, 8))

then format its columns as a date and time respectively in Column tools ribbon

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

Anonymous
Not applicable

Hi @Frixel ,

According to my understanding, you want to split the Timestamp column into Date column and Time column without “(”,”)”,right?
For my example, I did it in two ways.

1.Using the following formula:

 

Date column =
LEFT ( SUBSTITUTE ( [Timestamp], "(", "" ), 10 )
Time column =
RIGHT ( SUBSTITUTE ( [Timestamp], ")", "" ), 7 )

 

And then change the two columns’ Data type from “Text” into “Date” and “Time” separately.
1.png

My example visualization looks like this:

2.png

2.Apply some steps in Query Editor(Advanced Editor)

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W0jDTNTLVNTIwMlAwsLQyNLIyMtJUitUBSljoGhljlTA00DUwh8sYG1gZGABlYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TimeStamp = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"(","",Replacer.ReplaceText,{"TimeStamp"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",")","",Replacer.ReplaceText,{"TimeStamp"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Replaced Value1",{{"TimeStamp", type datetime}}),
    #"Inserted Date" = Table.AddColumn(#"Changed Type", "Date", each DateTime.Date([TimeStamp]), type date),
    #"Inserted Time" = Table.AddColumn(#"Inserted Date", "Time", each DateTime.Time([TimeStamp]), type time)
in
#"Inserted Time"

 

3.png

Are these results what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Frixel ,

According to my understanding, you want to split the Timestamp column into Date column and Time column without “(”,”)”,right?
For my example, I did it in two ways.

1.Using the following formula:

 

Date column =
LEFT ( SUBSTITUTE ( [Timestamp], "(", "" ), 10 )
Time column =
RIGHT ( SUBSTITUTE ( [Timestamp], ")", "" ), 7 )

 

And then change the two columns’ Data type from “Text” into “Date” and “Time” separately.
1.png

My example visualization looks like this:

2.png

2.Apply some steps in Query Editor(Advanced Editor)

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W0jDTNTLVNTIwMlAwsLQyNLIyMtJUitUBSljoGhljlTA00DUwh8sYG1gZGABlYgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [TimeStamp = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"(","",Replacer.ReplaceText,{"TimeStamp"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",")","",Replacer.ReplaceText,{"TimeStamp"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Replaced Value1",{{"TimeStamp", type datetime}}),
    #"Inserted Date" = Table.AddColumn(#"Changed Type", "Date", each DateTime.Date([TimeStamp]), type date),
    #"Inserted Time" = Table.AddColumn(#"Inserted Date", "Time", each DateTime.Time([TimeStamp]), type time)
in
#"Inserted Time"

 

3.png

Are these results what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
az38
Community Champion
Community Champion

Hi @Frixel 

try

 

Date Column = DATEVALUE(MID([Timestamp Column], 2, 10))

 

and

 

Time Column = TIMEVALUE(MID([Timestamp Column], 13, 8))

then format its columns as a date and time respectively in Column tools ribbon

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.