I want to have an automation which conditionally changes the status of an item

For eg ,There are two dates column

  1. Date
  2. Due Date

Due Date is set before Date.

Now I want to change the status on column change (Which is Date here) based on if the date selected is less tha x no. of days from due date.

Is it possible, If Yes??