Forum

Adding dates and ho...
 
Notifications
Clear all

Adding dates and hours

5 Posts
2 Users
0 Reactions
49 Views
(@matt-jonsson)
Posts: 25
Eminent Member
Topic starter
 

Hello,

 

I'm struggling with a dataset that I downloaded from a webpage. The date format is: DD-MM-YYYY in one column, and the hours are: HH - MM in a separate column.

I've been trying to do all sorts of things, but hopefully there is a smarter way of doing this. What I want is a column with the format. YYYY-MM-DD HH:MM, where the hours alway will be full hours. 00:00, 01:00 .....23:00.

I have managed to convert the dates in Excel with the "Text to column" feature. But when I try to combine the dates with hours, it doesn't work. I hav tried to use the TEXT function, but the YYYY doesn't work.

I have attached two files:

Elspot-Prices-2020-START, where the first two columns are the ones that I need to use.

Elspot-Prices-2020-FINISHED, is not really finished. But it shows that I have managed to get the date column correct when looking at it. But as you can see in the CateInText-column, there is something wrong.

What I want, is ONE column with the format: YYYY-MM-DD HH:MM. Preferably it will be done in Power Query, but there I got a error message on row 289 because it thinks that the dates are YYYY-MM-DD.

Is there any workaround that I can use?
Thank you so much!
BR

Mattias

 
Posted : 09/11/2021 10:23 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Mattias,

The files didn't upload. After selecting the file be sure to click the Start Upload button and then wait for the grey check mark beside the file size before clicking Submit Reply.

Mynda

 
Posted : 09/11/2021 7:11 pm
(@matt-jonsson)
Posts: 25
Eminent Member
Topic starter
 

New try

 
Posted : 10/11/2021 8:28 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Mattias,

Thanks for sharing your files. You need to use Change Type > Using Locale covered in lesson 4.03 of the Power Query course. You'll see the connection only query in the attached file that demonstrates.

Mynda

 
Posted : 10/11/2021 7:23 pm
(@matt-jonsson)
Posts: 25
Eminent Member
Topic starter
 

Hello,

Thank you! I did the steps my self and it worked. My memory is very good. But short... 🙂 I simply forgot that I had watched that video a month ago!

All good!
Mattias

 
Posted : 11/11/2021 3:49 am
Share: