Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Replacing a Datekey in integer format with todays date as integer

Hi,   I have a table with a datekey column as an integer on the form yyyymmdd. I want to replace the values 10010101 to today's date in power query. So today I will want to replace 10010101 to 2023...
  • slorin's avatar
    3 years ago

    Hi,

    add Number.FromText

     Table.ReplaceValue(Previous_Step,10010101,Number.FromText(DateTime.ToText(DateTime.LocalNow(),"yyyyMMdd")),Replacer.ReplaceValue,{"Date"})

    Stéphane