none
How to create logical test for dates older than a week in PowerQuery RRS feed

  • Question

  • I want to create a new column in my Power Query data table that displays "old" if my modified date is older than a week and "new" if the modified date is within the past week.  

    In Excel, my formula would look like this:

    =IF(TODAY()-7>Projects[@[Modified Date]],"old","new")

    I'm having trouble writing this into Power Query as a new column.  I have tried the following formula but am not having any luck:

    If (Date.AddDays(DateTime.LocalNow(),-7)>[Modified Date]) then "Old" else "New"

    Any help would be appreciated.

    Thursday, May 5, 2016 9:58 PM

Answers