Forum Discussion
ColinCowan
3 years agoHelper I
Replace Numbers with Date Sequencial
Hi, hoping someone can help my aim is to replace the numbers with the specified date after each date change.
Hi, thanks that works and easier much appreciated.
Regards Colin
Hi ColinCowan ,
My pleasure!
If it works, would you mind accept it as solution? Then more people who have the same requirment will find the solution quickly and benefit here, thank you!
Best Regards,
Community Support Team _ kalyj
12 Replies
- Greg_DecklerCommunity Champion
ColinCowan You can do this:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTSNzbUN7SwtFQwsjI1tTIwUAjwVYrVAcqASSMwaQ4mjcGkCZg0BZMWYNIMiUQyz9jKGNk8iA5DUySjDCF6LGHmxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Column2", each try DateTime.FromText([Column1]) otherwise null), #"Filled Down" = Table.FillDown(#"Added Custom",{"Column2"}), #"Removed Columns" = Table.RemoveColumns(#"Filled Down",{"Column1"}), #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Column2", "Column1"}}) in #"Renamed Columns" - ColinCowanHelper I
Greg, I adde a custom column copy pasted the formula and ended up with this. Please rememer I am a complete novice.
- Greg_DecklerCommunity Champion
ColinCowan I'll walk you through it.
- Get rid of that column you just added.
- Add Column tab in the ribbon, Custom Column
- Paste this into the formula area: try DateTime.FromText([Column1 - Copy]) otherwise null
- Click OK
- Right-click the header of your new column and choose Fill and then Down
- Remove your original column (Column1 - Copy) by right-clicking the column header and choosing Remove
- Rename your new column if you so desire
- ColinCowanHelper I
Greg
See result