To calculate the cost of margin leakage, you need to identify areas of profit loss. First, conduct a price waterfall analysis, analyze costs associated with products and services, and monitor customer profitability. Once you have identified these leaks, you can estimate the financial impact by adding up the costs associated with each leak.