This part works quite well when I ask for it to return me a date: (date(min({<Mes={"=max(Mes)"},Semana=>}%DataID)))
Still when I fit it inside the sentence, it doesn't work! And the sentence seems to work fine because if I paste some other date there, it returns me a SUM!