Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
ColinCowan
Helper I
Helper 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.

ColinCowan_0-1664922023590.png

 

2 ACCEPTED SOLUTIONS

Hi, thanks that works and easier much appreciated.

 

Regards Colin

View solution in original post

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

View solution in original post

12 REPLIES 12
ColinCowan
Helper I
Helper I

Greg, I adde a custom column copy pasted the formula and ended up with this. Please rememer I am a complete novice.

ColinCowan_0-1664924872974.png

 

 

@ColinCowan I'll walk you through it.

  1. Get rid of that column you just added.
  2. Add Column tab in the ribbon, Custom Column
  3. Paste this into the formula area: try DateTime.FromText([Column1 - Copy]) otherwise null
  4. Click OK
  5. Right-click the header of your new column and choose Fill and then Down
  6. Remove your original column (Column1 - Copy) by right-clicking the column header and choosing Remove
  7. Rename your new column if you so desire


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Greg

See result

 

ColinCowan_2-1664927294326.png

 

 

@ColinCowan Apparently there are extra spaces or something in there. Delete [Column1 - Copy] in your formula and leave your cursor at right after the (. Double-click your column in the Available columns section. Click OK.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Greg, I tried this also

ColinCowan_0-1664928593054.pngColinCowan_1-1664928663102.png

 

 

 

 

 

Greg

 

Error code

ColinCowan_0-1664929447219.png

 

 

@ColinCowan No, that's not the formula I posted, the formula for your added column is:

try DateTime.FromText([Column1 - Copy]) otherwise null

Your added column formula is literally not that. At all. Your formula doesn't include the try statement or the otherwise. See PBIX attached below signature.

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Greg

 

Thanks Can I reset as I am now confussed should the formula be

 

ColinCowan_0-1664933910433.png

 

Hi @ColinCowan ,

Another way maybe easy to understand for you.

1.Select the column then click Data Type option.

vkalyjmsft_2-1664958746352.png

2.Select Date/Time.

vkalyjmsft_1-1664958485570.png

3.Then you will find the numbers return error, right-click the column and select Replace Errors.

vkalyjmsft_3-1664958875079.png

4.Enter null in the dialog.

vkalyjmsft_4-1664958941444.png

5.Select the column, then click Fill Down.

vkalyjmsft_5-1664959004381.png

Result:

vkalyjmsft_6-1664959046639.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

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

Greg_Deckler
Community Champion
Community 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"


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors