Forum Discussion
BishwaR
5 years agoHelper V
New Date Column
I need to create a new Product Expiration column in power query ( No Dax) I have an existing Product Expiratioin column but besides that I need to create a new Product Epiration column where all ...
- Anonymous5 years ago
Table.AddColumn (LastStepName, "Expiration Date", each if [DateColumn] >= Date.AddDays(Date.From(DateTime.LocalNow()), -90) then Date.AddDays(Date.From(DateTime.LocalNow()), +90) else [DateColumn])
--Nate
Anonymous
5 years agoNot applicable
OK, if I understand correctly, for Expiration dates that are today through the next 90 days, use today+90 else use current Expiration date. If so, it's:
Table.AddColumn (LastStepName, "Expiration Date", each if [DateColumn] >= Date.From(DateTime.LocalNow()) and [DateColumn] <= Date.AddDays(Date.From(DateTime.LocalNow()), + 90) then Date.AddDays(Date.From(DateTime.LocalNow()), +90) else [DateColumn])