The rule is very simple: Always FIRST segment! You always first split into the segments! Otherwise you create utter chaos with mutidimensional matrices (as can be seen in your tree - because if done accurately, you would then also need to split the fixed and variable costs into the different streams, which is completely chaotic!
So instead, you split as follows:
Level 0: [Profit]
Level 1: [Profit from Direct Sales] and [Profit from Retailers}
Level 2: For each segment: [Revenues] and [Costs]
Level 3: and so on...
P.S.: If you have indirect costs (which can not be clearly allocated to a specific segment), then you add these indirect costs to Level 1 --> then you have three branches on Level 1: [Profit from direct Sales] + [Profit from Retailers] - [Indirect Cost]