Calculate Database Field Value and Send to Views as New Field
Take a look at this, it shows how you can create custom fields that you can use within views https://www.webomelette.com/creating-custom-views-field-drupal-8

I've followed this recently and seems to work well