The gross profit margin is calculated by taking total revenue minus the COGS and dividing the difference by total revenue. The gross margin result is typically multiplied by 100 to show the figure as a percentage.