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
Jimmy801 When I saw that my query was bad today, I tried to fix it according to what you wrote me, but I'm still stucked with my problem.
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
- NumeroENAP6 years agoHelper III
Well, I found my problem on https://docs.microsoft.com/fr-fr/power-bi/service-admin-troubleshooting-power-bi-personal-gateway
It was indeed due to the data source.
I checked my datas, and there was a single data that wasn't right...
- Jimmy8016 years agoCommunity Champion
Hello
well... your syntax posted in the first post will never work, independent from your data source
Bye
Jimmy
- NumeroENAP6 years agoHelper III
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