Auto generated query not working
The condition:

where ( ("ANNO","MESE") IN ('2017','10'),('2017','11'),
                           ('2018','01'),('2018','02'),('2018','03')
   and  ("Invio") IN ('3'),('1'),('2') 
      )


has 2 issues:


first, it needs parentheses around the IN lists (and the ones you have around the two sub-conditions are redundant):

where   ("ANNO", "MESE") IN ( ('2017','10'), ('2017','11'),
                              ('2018','01'), ('2018','02'), ('2018','03')
                            )
   and  "Invio" IN ( '3', '1', '2' ) 

second, even if you fix the above, it won't work in SQL Server as this type of syntax (the first sub-condition, that combines IN with tuples) has not yet been implemented. You can rewrite in various ways, eg. using a JOIN and VALUES syntax:

from
      ( ...
      ) T  
    join
      ( values ('2017','10'), ('2017','11'), 
               ('2018','01'), ('2018','02'), ('2018','03') 
      ) as V ("ANNO", "MESE")
    on
      V."ANNO" = T."ANNO" and V."MESE" = T."MESE"
where  "Invio" IN ( '3', '1', '2' ) 
---

by the way, the subquery (aliased T) is not really needed. It ony adds complexity for those trying to read it:

select 
    T."ATC_1",
    SUM(T."Importo_Scarto") as "Importo_Scarto",
    SUM(T."Q_Scarto") as "Q_Scarto"
from 
      dbo.[MyTable] as T  
    join 
      ( values ('2017','10'), ('2017','11'), 
               ('2018','01'), ('2018','02'), ('2018','03') 
      ) as V ("ANNO", "MESE")
    on
      V."ANNO" = T."ANNO" and V."MESE" = T."MESE"
where 
    T."Invio" in ( '3', '1', '2' ) 
group by
    T."ATC_1" ;