Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Data4920
Frequent Visitor

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!

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
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.

Capture.PNG

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

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-piga-msft
Resident Rockstar
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.

Capture.PNG

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

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors