Hi,
Can someone please guide me the best way to get the below output:

What I need to do:
- Group by ID
- To find Total, I need to see if quantity is different within the same group pick the different quantity(unique within same group) price and total up that, if the quantity is same then use the same price for total
Thank you in advance