I believe it is not depending on the "1-", that's just an equivalent expression:
(1-cost/sales) = (sales-costs)/sales
I preferred the first, because I only need two sums then instead of three.
As said, the difference between our two versions is that I first sum up Costs and Sales over all record rows and then do the Margin% calculation (1-cost/sales), instead of doing the calculation per row and then summing up.
I figured out my problem was the Date needed to be the Date_Num field in my data. But I'm still confused on how this is supposed to work. Camilo, can you post your final solution? It would just nice to look and see how your graph ended like. Thanks.