P&L metrics found on dashboards and metric tables are based on both product-level and aggregate level calculations that factor in either:
Default Average Product Profit Margin: Under Account Settings > Account Edit > Product Settings this value is used to build both the Margin and Cost (COGS) on an individual product basis. This data is then rolled-up on reporting tools such as Dashboards
Margin Tool (Hard Cost): Found under Products > Margin Tool, this feature can be used to upload product-level hard costs into the app. These values are then used to calculate more accurate Margin and Cost (COGS) metrics across the app. Check out this guide on using the Margin Tool