I'm assuming that you have a field named Group by which your sort your records to get groups.
If so, make the calculation:
GetSummary( ProfitSum ; Group ) / GetSummary ( SellingPriceSum ; Group )
Note that the "break" field (Group) in the GetSummary function should be the same field as the "when sorted by" field you are using in a sub summary part to display the group subtotals for selling price and profit.
Thanks and it works for one level group. I have three level groups and I can get one level margin only. How can I get three lebel group?
I worked it out by three calculation fields. Thanks