Forum Discussion
Atinder
4 years agoHelper III
Add IF date formula in the custom date
Hello, I want to add a custom date column in the table by using IF function. I want to see what items I received today by the posting date. = Table.AddColumn(#"Expanded PostedPO", "Custom...
- 4 years ago
My bad, I used the wrong syntax.
How about this:
= Table.AddColumn(#"Changed Type", "Custom", each if [PostedPO.Posting_Date] >= Date.AddDays(Date.From(DateTime.LocalNow()), - 1) then "yes" else null)
/Tom
KNP
4 years agoSuper User
In the 'Custom Column' box you just need to enter this part...
if [PostedPO.Posting_Date] >= Date.AddDays(DateTime.LocalNow(),-1)) then "yes" else null
Not from the "Table.AddColumn...."
If this works, please accept Tom's answer as the solution, not this one.
Atinder
4 years agoHelper III
I am also getting this error
- KNP4 years agoSuper User
Apologies, I copied the wrong text from tackytechtom's answer. Use the below instead.
Again, please accept Tom's answer if this solves your problem.
if [PostedPO.Posting_Date] >= Date.AddDays(Date.From(DateTime.LocalNow()), - 1) then "yes" else null