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
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