Active Member
November 5, 2021
I have a report that gives me, for a number of accounts, both the target for each month of the year, and the sales actually achieved as at the date I last refreshed the report - and data for all of previous years too; (and because we are spread across multiple countries it is in various currencies, although that's not relevant to this question).
For most reporting relatively simple pivot table(s) and some GETPIVOTDATA functions will gather and calculate the data I need on a month-by-month basis. The challenge I'm up against is comparing YTD against target and especially against previous years. I can do it the clunky way, by pulling down the individual month numbers, then adding up them up separately, with a SUM($A1:A1) style formula copied rightwards, but surely there must be a way of doing this more elegantly?
Bear in mind that although the base report contains some sales figures for the current month, my YTD comparisons are only wanted up to the latest completed month.
July 16, 2010
Hi Peter,
Generally you'd have the prior year data and current year data in the same table. You can then use calculated fields:
https://www.myonlinetraininghu.....y-position
https://www.myonlinetraininghu.....ison-video
Or if you're using Power Pivot, you can use the time intelligence DAX functions to get the prior period data for comparisons.
Hope that points you in the right direction.
Mynda
Active Member
November 5, 2021
Thanks Mynda
Yes, I have the prior year data and current year data in the same table, but I've yet to get to grips with calculated fields and PowerPivot. However I found a work-around buried in the "Value Field Settings" which may be useful to others.
In the ∑ Values box of my Pivot Table I put in a second copy of the monthly values (Sum of TARGETSALES, Sum of ACTUALSALES in my case), then in "Value Field Settings", on the tab "Show Values As" select "Running Total ln" in the first drop-down and the DATE in the Base Field, and change the Custom Name at the top of the Dialog box to YTD_TARGETSALES (and YTD_ACTUALSALES).
I'm not sure why, but the running total seems to reset to zero at the start of each year, so this works to get exactly the numbers I want, and then with one GETPIVOTDATA function divided by another, I get my comparisons against Target, and against previous years.
I probably should have known about that "Running Total" option before - but this is certainly a lot quicker than bring down the monthly numbers individually and then summing them.
July 16, 2010
Glad you found a solution, Peter. If you want a way to avoid the running total resetting, you can use Power Pivot as described here.
1 Guest(s)