I suspect that your variable definition begins with the equal sign, right? If that's the case, it means that your expression is being calculated once, not in the context of your chart dimensions. For that reason, you are getting identical values across the chart. For the same reason, the result looks better if you make a selection - after your selection, the formula in the variable gets evaluated again, and it shows a "better" result now.
Long story short - remove the equal sign in front of your formula in the variable definition and see what happens.