Forum Discussion
Power Query formula
- 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"
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
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"
- BA_Pete4 years agoSuper User
Hi Anonymous ,
I'm obviously in a different timezone as your questions above all came through overnight.
Your final code is correct. I wrote the calculation freehand and forgot to close off the Date.StartOfMonth functions on both the condition lines, but you've got it sorted.
Sorry I wasn't available to help you at the time.
I'm going to update my post with the correct parentheses so it will hopefully help anyone else who has the same requirement.
Pete