I have a calculated field in a query that takes our total revenue per customer and subtracts out total costs per customer to get our margins with that customer. The formula works fine as long as the customer has a cost value but if the customer has no cost, the formula is ignoring that revenues exists and is excluding that customer from the total and the query does not include them in the returned result. Is there a way to fix the formula to include these customers with no costs but still generate revenue?
SELECT [Company Information].[Company Name], ([2 YTD - Customer
Revenues].SumOfSumOfCharge-[2 YTD - Customer Costs].[SumOfTotal Cost])
AS [Customer Margin]