It works only in case I don't choose anything or of I choose both current and previous months, for example November and October, or October and September etc. But it DOES NOT work if I choose only 1 month, for example October. I expect it to show me September sales and I even know the reason it doesn't, I just don't know how to solve it:
the reason is that if the user choose October, the formula does calculate for September (>=1/09/16 <= 30/09/16) but it can't bring those RowIDs that were in September. I guess it still brings RowIDs of October which are never the same as in September, and that's why the result is 0.
I tried to do another set analysis of dates inside the Aggr but it still didn't work...
Although I have seen (somewhere) that Aggr allows you to use set analysis, but not sure if this is just a recent thing or if this was always the case. In this case (not knowing which version you are using), I think using Only() is equivalent of not using anything, but in order to use the same set analysis that is used in the outside aggregation, you basically had few options:
In your particular case they will all work, but the main thing to note is that you needed some kind of aggregation function to use set analysis.