Thanks for answering but I'm not sure.
Let's imagine that there are many date in the Date Dimension, date from 2013/01/01 to 2020/12/31 and you have sales from 2013/04/01 to today. How do you write your SA statement knowing if your would like to take the max date in account ?
I think that we should handle link in that case.
That would depend of your exact requirements. Please, see my answer in your other thread: Sum data if a month .
Another way to do it, since you seem to want a solution modifying the script, would be to create a second that field exclusively in the Sales Fact.
date as SalesDate,
Then, you could use the new field SalesDate (which will have sales only til today) in the set analysis.