It seems to me that your maximum DATA per MES and PRODUTO might be static (not depending on selections), so you could add a flag to your data model (add these lines to your script):
LEFT JOIN (Calendario) LOAD
max(DATA) as DATA,
1 as MAXDATAFLAG
Resident Calendario group by MES,PRODUTO;
and use this as expression in your chart with dimensions MES and PRODUTO:
I think it's not possible to use Set Analysis in the way how the data looks as there is no unique connection between DATA and MES...and I think thats the problem here. Guess you have to script it differently (e.g. sript calendar-table and data-table separately) - then set analysis should be no problem.