Hi Leandro,
What I did not understand here is that why do you want "DISTINCT" keyword on your ID. ID, by itself is the primary key and no 2 records will have same IDs. So, ID itself is DISTINCT.
However, coming to the requirement, you can definitely do a distinct within the select statement, something like:
*SELECT(%MYVAR%,[YEAR],"CATEGORY",YEAR in (SELECT DISTINCT [YEAR1] FROM dimCategory) )
*XDIM_MEMBERSET TIME = %MYVAR%
This is just an example and is a valid statement. You can use this as per your requirement. You can combine different conditions in your statement.
Hope this helps.