that's quite a challenge for a start
You could maybe use
to keep close to your approach using above function.
I think it is working (see attached sample), but using above, the results may depend on sort order.
And using the aggr-function around above, I think the order for above is determined by load order.
Probably there are some other approaches to solve your request, I leave it to others for today.
Hope this helps and have fun,
TestCrossDimPercentage.qvw 141.5 K