• 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

Calculate average in Power Pivot (or Power Query?) - Office365|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Calculate average in Power Pivot (or Power Query?) - Office365|Power Query|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 ForumPower QueryCalculate average in Power Pivot (o…
sp_PrintTopic sp_TopicIcon
Calculate average in Power Pivot (or Power Query?) - Office365
Avatar
Jeroen Juwett

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
January 31, 2020
sp_UserOfflineSmall Offline
1
February 5, 2020 - 10:05 pm
sp_Permalink sp_Print

Hi,

Am trying for weeks now to add an average in a pivot table. It seems so obvious, but somehow I miss out somewhere.

To test different solutions I made a small testfile with a few data in a dataset. Loaded this into PowerQuery, transformed a bit and loaded in into Excel. Then I created a pivottable with the product as row, the month as column and the sales as values. So far it works. At the end of every column and row there is a Grand total. Perfect.

Now I want to add an extra column as an average of a product over the total of the months. Not every month an average (like most solutions do) but only one figure after the grand total stating the average sale of a product in this yeqr. Can't be too hard....

Probably I need to use a measurement for this, but where and how...?

Hopefully anyone can give me a clue. I am a novice Power Query and Pivot user.

Thanks!

Jeroen

(the testfile is added to this topic)

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
February 6, 2020 - 2:17 pm
sp_Permalink sp_Print

Hi Jeroen,

Unfortunately, regular PivotTables and Power Pivot PivotTables won't show the months broken out for one aggregation method (sum) and not another (average). It's either all or none.

I recommend you add another PivotTable beside with the average sales not broken out into months, and then just hide the row labels column of that PivotTable so it appears to be part of the original PivotTable. You'll need to take care that they remain in sync with each other in terms of the row labels.

Mynda

Avatar
Jeroen Juwett

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
January 31, 2020
sp_UserOfflineSmall Offline
3
February 7, 2020 - 7:56 pm
sp_Permalink sp_Print

Hi Mynda,

Thanks for your quick reply. That's really amazing.

I must study on this new view. I thought it would be easy and that I just lacked the knowledge. I need to get back to the philosophy of things.

Hmm, if I come up with a solution I will post and share this.

PS: I do love your pace in the course videos while I am doing my training exercises in the gym (that's the way I study :-))

Thanks, Jeroen

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
February 7, 2020 - 8:15 pm
sp_Permalink sp_Print

🙂 glad you're enjoying the course. Can't say I've ever heard of anyone learning Excel in the gym before!

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 613
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
5
February 12, 2020 - 6:52 pm
sp_Permalink sp_Print

What you could do with a Power Pivot PT is to create a measure to average the monthly totals (eg =AVERAGEX(values(Table_after_Power_Query[month]),[TotalSales])), then create a set based on columns so that you only show that average calculation for the total column, not the individual month names.

sp_AnswersTopicAnswer
Answers Post
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
February 12, 2020 - 9:22 pm
sp_Permalink sp_Print

Great idea, Velouria! I never think to use Sets.

Avatar
Velouria
London or thereabouts
Moderator
Members


Trusted Members

Moderators
Level 4
Forum Posts: 613
Member Since:
November 1, 2018
sp_UserOfflineSmall Offline
7
February 12, 2020 - 9:47 pm
sp_Permalink sp_Print sp_EditHistory

They're not the most flexible things, but can be handy on occasion. 🙂

Avatar
Jeroen Juwett

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
January 31, 2020
sp_UserOfflineSmall Offline
8
February 13, 2020 - 7:51 pm
sp_Permalink sp_Print

Wow Velouria, this did the job!

I added my table to the datamodel.

Entered the measurement in the datamodel as AVERAGEX(VALUES(columname);CALCULATE(SUM(columname))) and this gave the filtered average which I wanted.
It seems to me that entering a measurement in the datamodel works better then trying to make a measurement in Power Pivot (Office365), however I do not know how to "name" (label) the measurement, since it is no longer accessible in Power Pivot where you can add a name and description, which is not available in the datamodel.

In PowerPivot you can then easily create a set and remove all columns I do not want. With the correct result!

I do have some challenges now to make the view nice, because the set has blocked some cells in te result where I want to overwrite the labels and use other fonts and colors to make a clean and esthetic dashboard.

Thanks again, and I am going to find a way to give a name to my measurement and to add some esthetics to the result.

Kind regards, Jeroen

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Andy Kirby, Richard Benson-King
Guest(s) 9
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:
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Len Matthews
Kristine Arthy
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27210

 

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