Forum Discussion
Replace future dates by today date
- 6 years ago
Hello NumeroENAP
as far as I know the function Table.ReplaceValue just replaces and old value with a new value. Use this syntax instead (not tested)
= Table.TransformColumns ( #"Column", { { "Date created", each if _ > Date.From(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 - 6 years ago
Try:
= Table.ReplaceValue(#"Column", "Date created", each if DateTime.FromText([Date created])> DateTime.FixedLocalNow() then DateTime.FixedLocalNow() else [Date created])
Hello NumeroENAP
as far as I know the function Table.ReplaceValue just replaces and old value with a new value. Use this syntax instead (not tested)
= Table.TransformColumns
(
#"Column",
{
{
"Date created",
each if _ > Date.From(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