If I have 2 fields in db - probability and influence and I need a column in GridView where these two fields are multiplied. I managed to add it there like:
Here is my solution, which works for sorting non-table field
$dataProvider->sort->attributes['customer'] = [ 'asc' => ['customer' => SORT_ASC], 'desc' => ['customer' => SORT_DESC], ];