Forum Discussion
Getting errors with a column transformation (future dates to today's date)
- 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
Hello
well... your syntax posted in the first post will never work, independent from your data source
Bye
Jimmy
Urgh, I thought it was the data that was the problem, but no...
I tried to compare my query with the one you provided, but it still doesn't work.
Mine :
= Table.TransformColumns(#"LastLine", {"Date created", each if [Date created] > (DateTime.FixedLocalNow()) then Date.From(DateTime.FixedLocalNow()) else [Date created], type date})
Yours Jimmy801
= Table.TransformColumns(#"LastLine", {"Date created", each if [Date created] > (DateTime.FixedLocalNow()) then Date.From(DateTime.FixedLocalNow()) else [Date created], type date})
I replaced the "_" with my [column name].
Otherwise, my tablename is "SOURCE". I don't know if it was supposed to go somewhere in my synthax.
Thanks
- TheDataMustFlow6 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?
- NumeroENAP6 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.
- Jimmy8016 years agoCommunity Champion