Hi,
Create new DSO with...
Fiscal Year, Posting Period, Material group as Key fields
Valuation Class and Price as Data fields. In Price KF definition, keep as Average in Aggregation tab by taking the reference as Material Group
Map the required fields from the first DSO to this new DSO. Hence, you will get the desired output.
Regards,
Suman