Thanks for the reply. Sorry that not what I'm looking for and apologies for not explaining my problem correclty
Type is dimension and month shown there is a date field
and numeric value is sum of sales
I want to add a column that shows sum of last two months sales
I would strongly suggest that you pivot the data, you really only have 2 dimensions (Type and Time) and 1 measure (Sales ??)
Once you've pivotted, the calculations you're talking about will be a lot more simple and easy to implement.