If I understand correctly, you're trying to vary the background colors by expression? If that's correct maybe try a nested if like;
if(sum(Sales)< 1000, blue(),
Also a search for nested if or color by expression would yield a few examples.
Hope this helps