unfortunately it is not possible to rank by a formula due to some technical challenges, same applies also for other calculations like moving averages and differences.
As a workaround in Lens has been introduced the custom metric ranking (like the agg-based editor had).