hm as a workaround I am sure you are already considering custom fields and then filtering based on that and the total quantity can be displayed when setting up reports.
Also I have seen many use a combination of tasks and subtasks for similar cases and then they use the column function in list view to either create a sum, average, etc
But I don’t recommend this when there are a lot of subtasks under a task as it will get quite messy and there is a limitation for the max subtasks to use the calculation feature, see point 4.9 here.
What might also work is to have one main project and then several others per group such as “Fruit Group”, “Bread Group”, etc
Then the tasks that fit into a group are multihomed. This way you can see only these tasks there then and can work.
Also here is a feedback request thread that I think could be interesting for you: