Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating prior month based on selection

Hi

I am calculating sum for current month and prior month based on the selection, for if I select 2013 January, it calculate Revenue  for 2013 january under current month and 2012 december for prior month. As soon as I select the current month it automatically calculates for current month.How do we calculate for prior month?  if I select the month for Jan 2013 it should calculare for december 2012. I really need help on this.

Thanks,

Abhi

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

IF you have a Date Dimension try this

=Sum({<YearDimension=, MonthDimension=, Date={'>=$(=MonthStart(Max(Date), -1))<=$(=MonthEnd(Max(Date), -1))'}>} Sales)

Hope this helps you.  If not works can you attach some sample data.

Regards,

Jagan.

View solution in original post

5 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

IF you have a Date Dimension try this

=Sum({<YearDimension=, MonthDimension=, Date={'>=$(=MonthStart(Max(Date), -1))<=$(=MonthEnd(Max(Date), -1))'}>} Sales)

Hope this helps you.  If not works can you attach some sample data.

Regards,

Jagan.

Not applicable
Author

Works like a Champ Jagan, Thank you Sir!

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please close this discussion if it helps you by giving correct answer to my post.  It helps others in finding the answers for similar type of solutions.

Regards,

Jagan.

Not applicable
Author

How to close the discussion here?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please click the Correct Answer to my post.

Regards,

Jagan.