prior year and current year query

prior year and current year query

Hello I am looking to write a query that would produce the sales for a Id for current year and previous year. I unable to use a pivot because the amount of data and there will be other equations i will use off it. I would like this to be dynamic.