Forum Discussion
Creating custom columns keeps returning a structured Table column
For example, since Power Query isn't able to autoconvert the column Date, which is in yyyymmdd format, into date format, I've been trying to convert it using different custom column calculations, but every time I attempt this, I either get an error or a structured column filled with Table links. When I try to expand the resulting Proper Date column, I end up with extra rows. How do I fix this?
If you are using the UI to add a column you do not need to write "Table.AddColumn". You would only need to write everything you have after the 'each'
15 Replies
- jgeddesSuper User
Power Query will convert that date column to a date format if you specify the culture it needs.
https://learn.microsoft.com/en-ie/powerquery-m/date-from
The Date.From and Date.FromText functions both have that ability. - MasonMASuper User
Hi, you may need to change your data in 'Date' column to a 'Text' data type before your Add Column step.
I used some random data and gave it a try with below M and it works
= Table.AddColumn(#"Changed Type", "Custom", each #date( Number.FromText(Text.Start([Date], 4)), Number.FromText(Text.Middle([Date], 4, 2)), Number.FromText(Text.End([Date], 2)) ))Hope it helps:)