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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

convert string to datetime

Hi, I have a table like this :

mhv22_0-1665360978014.png

I need to convert the string to a datetime . The row 52 should be 06/09/2020 01:00:00, row 53 = 06/09/2020 02:00:00. So I can plot a series time by hour based on days. Is it possible?

Thanks in advance!

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Anonymous 

you can try this

Column = 
VAR _date=date(left('Table'[hourofday],4),mid('Table'[hourofday],5,2),mid('Table'[hourofday],7,2))
VAR _time=time(right('Table'[hourofday],2),0,0)
return _date+_time

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@ryan_mayu  . Thanks a lot! It worked perfect!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@Anonymous 

you can try this

Column = 
VAR _date=date(left('Table'[hourofday],4),mid('Table'[hourofday],5,2),mid('Table'[hourofday],7,2))
VAR _time=time(right('Table'[hourofday],2),0,0)
return _date+_time

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 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.