Forum Discussion
naoyixue1
Post Patron
3 years agoHow to replace the text with last week date in Power Query
Hey! I'm now trying to replace the text with last week date in power query, but failed. (see below exact changes I made)
Any thoughts? Thanks!
That's what I originally used to replace the...
- Anonymous3 years ago
Hi naoyixue1 ,
I think -7 should in Date.AddDays function. Please try code as below.
= Table.ReplaceValue(#"Filtered Rows3","Past",Date.ToText(Date.AddDays(Date.From(DateTime.LocalNow()),-7)),Replacer.ReplaceValue,{"Week"})Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi naoyixue1 ,
I think -7 should in Date.AddDays function. Please try code as below.
= Table.ReplaceValue(#"Filtered Rows3","Past",Date.ToText(Date.AddDays(Date.From(DateTime.LocalNow()),-7)),Replacer.ReplaceValue,{"Week"})
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.