I see you have tried using AGGR with no luck. Here is an explanation on how to use it correctly.
You need to enclose the IF expression inside an AGGR function and use SUM as outer expression. Don´t forget to add all the fields used in your chart dimension as dimensions for the AGGR.
Here is an example:
SUM(AGGR( <original expression> , MTM_field, Family_field))
When applicable please mark the appropriate replies as CORRECT https://community.qlik.com/docs/DOC-14806. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others