**Dataset Description: **

**Columns: **Brand, Market and Target.

Following dataset represent the target for four different brands A,B, C & D which are distributed among OPL & CPL market.

**What I want?**

Sum of Target for each of Brand at OPL (highlighted in orange) and sum of Target for each of Brand at CPL (highlighted in yellow)

For example,

sum for OPL should be 10000 + 7000 + 4000 + 9000 = 30000 and,

sum for CPL should be 5000 + 2000 + 8000 + 3000 = 18000

**What I did?**

I used this logic: **IF [Market] = 'OPL' THEN {FIXED [Brand]+[Market] : MIN([Target])} END**

Image as below:

The logic gave me total of target at OPL which is 58000,( which is not the one I wanted).

Can someone help me with the calculation part?