• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Extracting YTD totals from Pivot chart|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Extracting YTD totals from Pivot chart|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Extracting YTD totals from Pivot ch…
sp_PrintTopic sp_TopicIcon
Extracting YTD totals from Pivot chart
Avatar
Peter Lewis

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
November 5, 2021
sp_UserOfflineSmall Offline
1
November 28, 2021 - 9:54 pm
sp_Permalink sp_Print

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.   

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4448
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
November 29, 2021 - 5:02 pm
sp_Permalink sp_Print

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

Avatar
Peter Lewis

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
November 5, 2021
sp_UserOfflineSmall Offline
3
December 1, 2021 - 10:56 pm
sp_Permalink sp_Print

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. 

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4448
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
December 3, 2021 - 9:26 am
sp_Permalink sp_Print

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.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Chandler Davis, Ramon Lagos
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
michael serna
mashal sana
Tiffany Kang
Leah Gillmore
Sopi Yuniarti
LAFONSO HERNANDEZ
Hayden Hao
Angela chen
Sean Moore
John Chisholm
Forum Stats:
Groups: 3
Forums: 24
Topics: 6215
Posts: 27245

 

Member Stats:
Guest Posters: 49
Members: 31897
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.