• 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

Adding customised summary rows after a group in a pivot|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / Adding customised summary rows after a group in a pivot|Power Pivot|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
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 ForumPower PivotAdding customised summary rows afte…
sp_PrintTopic sp_TopicIcon
Adding customised summary rows after a group in a pivot
Avatar
Ahmad Algadeeb

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 29, 2022
sp_UserOfflineSmall Offline
1
May 29, 2022 - 2:39 pm
sp_Permalink sp_Print

I have been using pivot tables for a bit and they are time saving at times.

I have a database of projects their budgets and costs. I know that I can create custom subtotals and custom calculated columns, but was wondering if i could add a line underneath a subtotal to do a calculation e.g. i have one budget for the whole project but several categories of expenses. So I need to show the breakdown of expenses and at the end sum of it and then a new line showing the value of surplus or deficit. Another thing I just noticed, if I added it to a data model to create a measure and check the variance, I am not able to choose custom subtotals I would prefer to do it without VBA, but if it is a must, why not

I hope I can find a solution as otherwise will have to do it manual for above 50 tablespivot_question.jpegImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage pivot_question.jpeg (39 KB)
sp_AnswersTopicSeeAnswer See Answer
Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
June 3, 2022 - 7:35 pm
sp_Permalink sp_Print

Hi Ahmad,

You should not add custom rows in a pivot table, this is not just unusual but also not recommended, even if there are some workarounds.

Instead, you should have a table with those calculations, and add this table with a relationship to the parent table with expenses.

Avatar
Ahmad Algadeeb

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 29, 2022
sp_UserOfflineSmall Offline
3
June 3, 2022 - 11:33 pm
sp_Permalink sp_Print

Hi Catalin

 

thank you for your feedback. Just to make sure we are on the same page, what i meant by adding a row was a summary stat under the subtotal, do I make sense? 

if there is a way, would appreciate altering the file i attached or even create a new one

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
June 6, 2022 - 2:24 pm
sp_Permalink sp_Print

Hi Ahmad,

Custom rows are possible, you can take a look at these posts:

https://storybi.com/2022/04/09.....subtotals/

https://community.powerbi.com/.....d-p/200540

Can you create please a sample of the desired result, with normal excel formulas in a range, instead of pivot tables, so I can see exactly what you're after, including your formulas?

Thank you

Avatar
Ahmad Algadeeb

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 29, 2022
sp_UserOfflineSmall Offline
5
June 7, 2022 - 2:57 pm
sp_Permalink sp_Print

thank you for this Catalin. I will have a deeplook at the links you attached. They look promising and need a bit of work

 

attached is a sample below the row data

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
6
June 8, 2022 - 3:46 pm
sp_Permalink sp_Print sp_EditHistory

Hi Ahmad,

Building a data model needs a properly organized data.

For example, the budget seems to pe Per Project, not per expense, so repeating the budget at each row in the fact table is not right. It makes more sense to have a dimension table for budget per project.

You can use measures that are calculated only in the totals and subtotals areas:

Surplus/Deficit:=IF(COUNTROWS(VALUES(Table1[Expense]))>1,[Sum of Budget 2]-[Sum of Expense Value 2],BLANK())

Looks much cleaner than another custom row, IMHO:

 

Screenshot-2022-06-08-084016.pngImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage Screenshot-2022-06-08-084016.png (207 KB)
sp_AnswersTopicAnswer
Answers Post
Avatar
Ahmad Algadeeb

Active Member
Members
Level 0
Forum Posts: 4
Member Since:
May 29, 2022
sp_UserOfflineSmall Offline
7
June 8, 2022 - 4:18 pm
sp_Permalink sp_Print

Thank you for this Catalin; this makes sense although different than what I imagined; I like it

there is no way to add this below the subtotal line? instead of adding an extra column???? 

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
8
June 8, 2022 - 7:14 pm
sp_Permalink sp_Print

Screenshot-2022-06-08-110449.pngImage Enlarger

See image attached, you still have a few ways to customize the pivot using default tools.

sp_PlupAttachments Attachments
  • sp_PlupImage Screenshot-2022-06-08-110449.png (183 KB)
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Shanna Henseler, Lawrence Smith
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:
John Chisholm
vexokeb sdfg
John Jack
Malcolm Toy
Ray-Yu Yang
George Shihadeh
Naomi Rumble
Uwe von Gostomski
Jonathan Jones
drsven
Forum Stats:
Groups: 3
Forums: 24
Topics: 6212
Posts: 27236

 

Member Stats:
Guest Posters: 49
Members: 31889
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.