Maybe you should adjust the proportions when doing the allocation, then calculating on those?
Otherwise, it is pretty much impossible to help without a reproducible example: