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", each if [PostedPO.Posting_Date] >= #date(today()) then "yes" else null)
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
11 Replies
- tackytechtomMost Valuable Professional
Hi Atinder ,
This code snippet might help you:
Table.AddColumn(#"Expanded PostedPO", "Custom", each if [PostedPO.Posting_Date] >= Date.From(DateTime.LocalNow()) then "yes" else null)
Let me know!
/Tom
https://www.instagram.com/tackytechtom
- tackytechtomMost Valuable Professional
Hi Atinder ,
how about this:
Date.AddDays(DateTime.LocalNow(),-1)
/Tom
https://www.instagram.com/tackytechtom
- AtinderHelper III
- tackytechtomMost Valuable Professional
Hi @Atinder ,
Does it work that way?
Table.AddColumn(#"Expanded PostedPO", "Custom", each if [PostedPO.Posting_Date] >= Date.AddDays(DateTime.LocalNow(),-1)) then "yes" else null)
Let me know!
/Tom