I am looking to create a table, with product category as the dimension, that will include a column for the sum of all sales of each product in the previous year only including months up to the latest calendar month in the data for this year. So if the most recent date in the entire dataset is July 2016, then the column would sum sales for each product from January through to July 2015.
My data looks like this:
|Posting Date||Category||Total Value|
And my LOAD script like:
Month(Date([Posting Date])) as [Posting Month],
Year(Date([Posting Date])) as [Posting Year],
I attach a data set that contains these data fields.
Desired outcome is:
|Category||Sum Sales in 2016||Sum sales in same months in 2015|
Any help would be greatly appreciated