Forum Discussion
Anonymous
2 years agoNot applicable
Transform text column to Date
Hi, I power Query I have a text column YearMonth and I want to convert this to a date column. I can do this by creating a custom column but how can I do this by Transforming the column as I don't ...
- 2 years ago
Try
#"Transform to Dates" = Table.TransformColumns(#"Previous Step", { {"yearMonth", each let parts = Splitter.SplitTextByLengths({4,2})(_), partsN = List.Transform(parts, each Number.From(_)) in #date(partsN{0},partsN{1},1), type date }})
ronrsnfld
2 years agoSuper User
Try
#"Transform to Dates" = Table.TransformColumns(#"Previous Step", {
{"yearMonth", each
let
parts = Splitter.SplitTextByLengths({4,2})(_),
partsN = List.Transform(parts, each Number.From(_))
in
#date(partsN{0},partsN{1},1),
type date
}})