Forum Discussion
shanezer
2 years agoFrequent Visitor
Date in two formats
Hi, I have folders coming in but for some reason it is reading some a different way. I have changed them to text and tried to put a new column in but doesnt work. One when I change it to text is fine...
- 2 years ago
Hi shanezer, check this:
Before
After
let Source = Table.FromList({"23/05/2023", "20240518"}, (x)=> {x}, {"Date"}), TransformedDate = Table.TransformColumns(Source, {{"Date", each if Text.Contains(_, "/") then Date.FromText(_, [Format="dd/MM/yyyy"]) else Date.From(_, "en-GB"), type date}}) in TransformedDate
dufoq3
2 years agoCommunity Champion
Hi shanezer, check this:
Before
After
let
Source = Table.FromList({"23/05/2023", "20240518"}, (x)=> {x}, {"Date"}),
TransformedDate = Table.TransformColumns(Source, {{"Date", each if Text.Contains(_, "/") then Date.FromText(_, [Format="dd/MM/yyyy"]) else Date.From(_, "en-GB"), type date}})
in
TransformedDate