• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how to insert a flag in a new column for a specific date range in power query?

KJ.

New Member
While using Power Query in Excel, I want the following in an additional column:
If the date range in "order date" column is between 26-Sep-2024 and 29-Oct-2024, then the rows need to be tagged as ART, else BAU.

I added additional custom column and put the following formula to get the above result:
= if [order_day] >= #date(2024-09-26) and [order_day] <= #date(2024-10-29) then "ART" else "BAU"

However, I am getting the following error:
Expression.Error: 1 arguments were passed to a function which expects 3.
Details:
Pattern=
Arguments=

Does anyone know the resolve this error or alternative solution for my required result?
 
#date(2024,05,12) = 12 may 2024. That's your mistake... As #date needs 3 arguments: year, month, day. You gave it a date value.
 
Back
Top