Thanks for your reply.
I had a look of your QVW and actually I had drafted what you have done before. But this is not what I want. The objective is to show the TOTAL COST by CostGroup if the corresponding Revenue is zero or missing, while Revenue is calculated by RevenueGroup. Since Revenue records do not come with a CostGroup value and thus, if I put CostGroup as the dimension, I don't know how to handle revenue records in this situation. I know that AGGR function could help but i tried many ways and just it doesn't work out.