Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Add days to date in PowerQuery

I need some assistance with an if statement I need to create in Excel Power Query. The issue I am having is adding days to a date in the condition portion of the if statement. I'm not sure how to w...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 

     

    According to the error message, the error occurs because the data on both sides of  "<" sign are of different types. From the screenshot, it seems you don't change the data type with Power Query, so I guess that you may have changed the date column to date format in Excel, however its values are probably still in datetime type, which may cause this error. For example,

     

    To resolve this error, you can add a step to change the date column to date type in Power Query Editor before adding the custom column. 

     

    In addition, when you add this custom column, modify the last ELSE result to null instead of "".

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!