Forum Discussion
Anonymous
3 years agoNot applicable
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 20230609. Is there any way I can do this?
Hi,
add Number.FromText
Table.ReplaceValue(Previous_Step,10010101,Number.FromText(DateTime.ToText(DateTime.LocalNow(),"yyyyMMdd")),Replacer.ReplaceValue,{"Date"})Stéphane
3 Replies
- slorinSuper User
Hi,
= Table.ReplaceValue(Previous_Step,10010101,DateTime.ToText(DateTime.LocalNow(),"yyyyMMdd"),Replacer.ReplaceValue,{"Date"})Stéphane
- AnonymousNot applicable
I see that this solution returns the value as text, is it possible to change it to integer?
- slorinSuper User
Hi,
add Number.FromText
Table.ReplaceValue(Previous_Step,10010101,Number.FromText(DateTime.ToText(DateTime.LocalNow(),"yyyyMMdd")),Replacer.ReplaceValue,{"Date"})Stéphane