SSRS Reports IN AX2012

HI
i am working on ssrs reports in ax 2012 and have a query.

the requirement is to calculate the
sum of amountcur value from CustTrans table based on the month for the current year and previous year for all the months separately.Date to be taken is TransDate
Can anyone please tell me the logic and where to write the code as i have made this report using query.

E.g

For employee 1

Emp No JAN Feb and so on
Previous Year – Current Year Previous Year – Current Year

1001 sum of amount in Jan sum of amount in Feb

Any kind of help will be appreciated.