Forum Discussion
Anonymous
4 years agoNot applicable
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...
- 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)
jennratten
4 years agoSuper User
Hello! Here you go:
Table.AddColumn(#"Changed Type", "Status", each let today = Date.From ( DateTime.FixedLocalNow() ) in if [StartDate] <= today and [EndDate] >= today then "Active" else "Inactive", type text)
- Anonymous4 years agoNot applicable
jennratten Thanks for replying . Im getting this
"The name 'Changed Type' wasn't recognized. Make sure it's spelled correctly."
Im new to powerQuery . Any idea what im missing ?