It's not surprising that a nested aggr-function is slow. Are you sure that you really need it?
Beside this quite often determined the datamodel how performant gui-calculations could be. Therefore a different data-structure could be quite useful - fo example to put kWh and Price within one table and avoiding the aggr-stuff. Further if your datamodel is build with link-tables I suggest to rethink the entire datamodel.