Forum Discussion
Anonymous
4 years agoNot applicable
Power Query formula
Hello - We have business logic that says: Based on the forecsat lockdown month (we "lock" our CRM forecast down at the 1st of each month and give it a file name like October 2021), then add 2 mon...
- 4 years ago
Ah, ok.
Try something like this:
if [reqShipDate] >= Date.StartOfMonth(Date.AddMonths([lockDownMonth], 2)) and [reqShipDate] <= Date.EndOfMonth(Date.AddMonths([lockDownMonth], 2)) then "True" else "False"Pete
- Anonymous4 years ago
BA_Pete Thanks for your help. With some additonal help in the forums I eventually figured out the correct formula...but you got me a starting point!
if [Customer Requested Ship Date] >= Date.StartOfMonth(Date.AddMonths([Locked File Month], 2)) and [Customer Requested Ship Date] <= Date.EndOfMonth(Date.AddMonths([Locked File Month], 2)) then "True" else "False"
Anonymous
4 years agoNot applicable
BA_Pete I've added in my column names. Getting an error on the word "then" and it says token comma expected
if
[Customer Requested Ship Date] >= Date.StartOfMonth(Date.AddMonths([Locked File Month], 2)
and
[Customer Requested Ship Date] <= Date.EndOfMonth(Date.AddMonths([Locked File Month], 2)
then "True"
else "False"
Anonymous
4 years agoNot applicable
BA_Pete Hi Pete - Any idea what could be causing that error? I've tried adding commas in various places to no avail.