Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I probably have a pretty simple question but I can' figure it out. I have a simple table in which I have several figures which are calculated like this:
=sum({<cost_center_function = {'Sales'}> [Amount_actual] ).
Which in this case gives me the sales amount. Now I want to add a column with previous year. So if I select 2012 I automatically want to see 2011 in that column the same if I select 1 month, so if I select jan 2012, I automatically want to see jan 2011 etc.
I tried things like month-12 etc. but that doesn't work.
Hope you guys can help me!
Regards,
Paul
Now it changes but gives the same number as the current selection so not the same selection but a year ago.
Hi,
can u please attach ur file.
Regards,
Iyyappan.
Sorry I can't attach the file. Classified info...
Hi,
Any thoughts why it now only shows me the same period (so not a year back)?
Appreciate your help!
Regards,
Paul
Hi,
This will show the Previous Year value, because we are using "AddYears((SetDate),-1))", this will get you the previous years data.
=Sum({<costcenter= {'Sales'},SetDate={">=$(=MonthStart(AddYears((SetDate),-1))) <$(=MonthEnd(AddYears((SetDate),-1)))"}>}[amount_actual])
This expression is used for current year data
=Sum({<costcenter= {'Sales'},SetDate={">=$(=MonthStart((SetDate))) <$(=MonthEnd((SetDate)))"}>}[amount_actual])
Hope this helps you.
Regards,
Jagan.
Hi,
Thanks again for all your help. But it still returns the same numbers in each column, so still not looking a year back....
Hi,
Can you attach the sample file with sample data. It would be helpful in understanding the problem.
Regards,
Jagan.
I figured it out! Was something in my date table why it wasn't going correctly, but I solved it by adding an other variable.
Thanks a lot for your help!