When I have an issue like this, I create calcs to grab the intermediate values. And then I display those values in tooltips or on the text shelf to see what's actually happening under the hood.
Is [%D_Media Cost] actually getting calculated correctly? If you're just seeing colors, what are the actual values getting calc'd? Display them and see. And if the values are not actually getting calc'd correctly, what is the value of ABS(LOOKUP(ZN(SUM([Sum_Media Cost])), -1))? And LOOKUP(ZN(SUM([Sum_Media Cost]))?
See what actual values are getting used on a row-by-row basis. When I do this I can usually see where my logic fails.