I require a bespoke formula for my Calc spreadsheet.

After I export my orders csv file from our website, I open it with calc and add in 3 extra columns is CL, CM, CN

CM contains a formula which displays the total discount for this order. However, if there are 5 products in the order, this total discount displays in all the rows.

I therefore created column CN to display the total discount only once per order ID ie in the 1st row for the specific order as shown in image 2.

I need a formula for this please.

Thanks