Hi
I think you have a nestandar solution.
First créate your ítem in Unit as Unit of measure
Later, you must créate two variants, one for bag and one for palet.
If you want to see the sotck in each unit of measure, you just must see stock by variant.
Do you like this solution?
Regards