• 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
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Display total sum for each Pivoted column in Power Query|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Display total sum for each Pivoted column in Power Query|Power Query|Excel Forum|My Online Training Hub

vba course banner

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 ForumPower QueryDisplay total sum for each Pivoted …
sp_PrintTopic sp_TopicIcon
Display total sum for each Pivoted column in Power Query
Avatar
Chris Yap
Member
Members
Level 0
Forum Posts: 162
Member Since:
August 21, 2019
sp_UserOfflineSmall Offline
1
December 3, 2019 - 11:53 am
sp_Permalink sp_Print

Hi,

I got a similar case wanted to sum up Month for each column and display it,  understand that UI is not able to achieve it and need M Code,   had tried the recommendation in the following blog but it doesn't work for me.

is there any simplify way ?

 

Thank you

 

https://stackoverflow.com/ques.....ower-query

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4517
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
December 3, 2019 - 4:43 pm
sp_Permalink sp_Print

Hi Chris,

You can turn on the Total row in the Excel Table (as opposed to adding it in Power Query)? Table tab > check the box for the 'Total Row'. You'll need to insert the totals for the other columns as it will only automatically add it for the last column.

Mynda

Avatar
Chris Yap
Member
Members
Level 0
Forum Posts: 162
Member Since:
August 21, 2019
sp_UserOfflineSmall Offline
3
December 4, 2019 - 12:48 pm
sp_Permalink sp_Print

Hi Mynda,  so you are suggesting using excel table properties instead of M Code in PQ,   However when I click refresh all the total formulae are wiped off

attached the source csv file and the PowerQuery before refreshing

 

Thank you !

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4517
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
December 4, 2019 - 8:28 pm
sp_Permalink sp_Print

Hi Chris,

I can't reproduce the problem. It doesn't wipe the total row out for me. If I filter the GrpBy_Card_Company query to exclude, say Visa, then Close & Load, the table reduces by one line and the total row moves up accordingly. If I then edit the query again to put Visa back in, the table increases by one row and the total row moves down by one.

Refresh All also doesn't cause any issues.

If you can't get it to work I would suggest creating a PivotTable for the totals. Power Query isn't the place for summarising data. You should be using Power Query to clean your raw data ready for summarising with tools like PivotTables and formulas.

Mynda

Avatar
Chris Yap
Member
Members
Level 0
Forum Posts: 162
Member Since:
August 21, 2019
sp_UserOfflineSmall Offline
5
December 9, 2019 - 6:54 pm
sp_Permalink sp_Print

Hi Mynda,

Found out the reasons,  need to "check" the preserve column sort/filter/layout under table > External data properties,  by default it is uncheck,  probably you are using office 365 don't have such problem

cheers and thanks !

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4517
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
December 9, 2019 - 10:13 pm
sp_Permalink sp_Print

Ah, yes I am using Office 365. Glad you figured out the problem and thanks for sharing.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Kumud Patel, Bright Asamoah
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Charles DeGraffenreaid
Cathi Giard
Sarah Young
Henry Delgado
Alita Nieuwoudt
KL KOH
Forum Stats:
Groups: 3
Forums: 24
Topics: 6360
Posts: 27812

 

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