Forum Discussion
Add current date to a new column when another value is updated
Hi!
I have a list of devices with multiple attributes that I track in a table where I'm trying to insert the current date once a certain column is updated in that table. For example, when the [Status] column value changes from any value to 'Completed', I want a new custom column [Completion Date] to populate the current date for that particular item only as a static value. I'm not sure if I need to create a new filtered table first for all blank records in the new [Completion Date] field then run an If/Then statement to check for the conditions first? Any help would be appreciated!
Hi Data4920 ,
You could achieve your achievement with creating a custom column like below.
= Table.AddColumn(#"Changed Type1", "Custom", each if [Status] = "Complete" then DateTime.LocalNow() else [Status])
Here is my test output.
If you still need help, please share some data sample and your desired output so that we could help further on it.
Best Regards,
Cherry
1 Reply
- v-piga-msft
Resident Rockstar
Hi Data4920 ,
You could achieve your achievement with creating a custom column like below.
= Table.AddColumn(#"Changed Type1", "Custom", each if [Status] = "Complete" then DateTime.LocalNow() else [Status])
Here is my test output.
If you still need help, please share some data sample and your desired output so that we could help further on it.
Best Regards,
Cherry