Forum Discussion
NumeroENAP
6 years agoHelper III
Getting errors with a column transformation (future dates to today's date)
Hi, I want to replace future dates in my column by today's date, but i'm only getting errors. My query : = Table.TransformColumns(#"LastLine", {"Date created", each if [Date created] > (Da...
- 6 years ago
here the correct version of your syntax
= Table.TransformColumns(#"LastLine", {"Date created", each if _ > (DateTime.FixedLocalNow()) then Date.From(DateTime.FixedLocalNow()) else _, type date})
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
TheDataMustFlow
6 years agoFrequent Visitor
Don't replace the "_", it represents the row value of [Date Created].
If you insert the code exactly as Jimmy801 posted after the #"LastLine", then it should work.
If it doesn't, can you post the whole query?
NumeroENAP
6 years agoHelper III
Well, I was being stuborn because I didn't knew that I could use the symbol "_" in a query (oups).
It was my bad. Thank you TheDataMustFlow for this comprehensive answer.