I am having a difficult time aggregating the lowest level of a row group with SUM while aggregating all higher row headers by MIN.
My data is like this structured in a group like this:
Assembly
Parent
Child
Orders
Inventory
And an example of my dataset might look like:
Assembly | Parent | Child | Supply Type | Available Quantity
A1 | P1 | C1 | Orders | 0
A1 | P1 | C1 | Inventory | 50
A1 | P1 | C2 | Orders | 100
A1 | P1 | C2 | Inventory | 0
A1 | P2 | C3 | Orders | 50
A1 | P2 | C3 | Inventory | 100
I want to SUM the measures in the Supply Type rows when I collapse up to the Child row group, but then to show the MIN when I collapse to the Parent and Assembly row groups. For instance, if I collapse at the Child level I want to SUM and have C1 to show a total of 50 and C2 to show a total of 100, but when I collapse at the Parent level I want to see the MIN and have P1 show 50 and P2 show 150.
I was able to partially achieve what I am trying to do with:
{ INCLUDE [Child],[Parent],[Assembly] : MIN({ EXCLUDE [Supply Type] : SUM([Available Quantity])})}
But now at the lowest levels the Order and Inventory measures show the same numbers (which is not accurate) since the EXCLUDE
function is essentially ignoring the categories at the Supply Type row level.