Get count where number of occurrences = N

I think what you’re doing wrong is that you are trying to aggregate both of these when in either case one will produce a null for the other one. If I’m thinking of this correctly.

If you have a single order then it won’t be a multi order, and if it’s a multi order it won’t be a single order. So in either case you are aggregating them together and they are addining when each are null essentially.

Can you try and wrap both the avgNumOfSingleOrder and avgNumOfMultiOrders in an average and then divide by the avg of 2?

(avg(avgNumOfSingleOrders) + avg(avgNumOfMultiOrders)) / avg(2)?