Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Add Conditional column based on three dates

Hi All , I need some inputs regarding adding a new field "Status" . I have start date and End Date .  The logic Is , if current date is between startdate and End date then the status is "Active" el...
  • jennratten's avatar
    4 years ago

    Sorry, I have updated the script to use your table name.

     

    Table.AddColumn(tablename, "Status", each let today = Date.From ( DateTime.FixedLocalNow() ) in if  [Start_Date] <= today and [End_Date] >= today then "Active" else "Inactive", type text)