A dimension has to created based on or including one of these to become valid:
Your expression has/is neither of these. A dimension will also be calculated before any rows are produced based on all the dimensions in a chart - which if you think of it would be natural.
The Aggr() function is most likely what you would need to use in your case. Something like this could be a template for you to explore:
<Your complicated expression above> , <Dim1>, <Dim2>....
The <Dim1>, <Dim2> .... would be the other dimensions that your are using in your chart.