Create a formula for the item number - if the item is x,z, or z, then it's the special ""combined"" item. If it's not x,z,y, then it's just the item number.
if SO_InvoiceWrk.ItemNumber in [""x"",""y"",""z""] then ""Combineditem"" else So_InvoiceWrk.ItemNumber. Then do a group by this formula. Then move stuff in the Detail into this Group Footer. For this item, divide the qty summary by 3, for all others, just let it stay the summary.