• 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

Calculated Fields in Pivot Table|Dashboards & Charts|Excel Forum|My Online Training Hub

You are here: Home / Calculated Fields in Pivot Table|Dashboards & Charts|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 ForumDashboards & ChartsCalculated Fields in Pivot Table
sp_PrintTopic sp_TopicIcon
Calculated Fields in Pivot Table
Avatar
Anita Payet
Member
Members

Dashboards

Power Query

Power Pivot

Power BI

Excel Expert
Level 0
Forum Posts: 15
Member Since:
May 6, 2022
sp_UserOfflineSmall Offline
1
October 17, 2022 - 6:00 pm
sp_Permalink sp_Print

Hello again.

I have a pivot table with values every 30 min over 6 channels (AC1, AC2,AC3, PV1,PV2,PV3). 

I need to create a column that shows the formula (AC1+AC2+AC3)-(PV1+PV2+PV3) for each 30 min interval over 12 months of data.  Once I have this column I wiould then like to find the Max value of that column per month.

What's the best way to do this?  I looked at the calculated field dialog box but it wants to do the formula from the source data whereas this formula needs to come from a drill down of the source data.

The source file is too big to attach but I've added a screen shot.  For example: (B9+C9+D9)-(E9+F9+G9) = value in new column

Thank you for your help.  

sp_PlupAttachments Attachments
  • sp_PlupImage Screenshot-2022-10-17-175112.png (302 KB)
sp_AnswersTopicSeeAnswer See Answer
Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 202
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
2
October 18, 2022 - 3:03 am
sp_Permalink sp_Print

I have a couple of thoughts: one is to do calculated cells that aren't part of the Pivot Table. I do think, though, that your best option would be to send your data to the data model and do a calculated measure. I am almost certain you can create a measure that takes into account the filters on the Pivot Table. Unfortunately, I'm still new to them and don't have the formula off the top of my head.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4446
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
3
October 18, 2022 - 8:22 am
sp_Permalink sp_Print

Hi Anita,

What you want to do is group AV together and PV together and then take one group from the other, but when you group items in regular PivotTables you cannot add calculated fields.

So, your options are to add a column to your source data that classifies the channels into AV or PV and then use that field in your PivotTable, then add your calculated field, or as Jessica suggested, use Power Pivot and write a DAX measure. With the regular PivotTable option, you won't see the individual channels, only the totals of the channel groups.

Mynda

Avatar
Anita Payet
Member
Members

Dashboards

Power Query

Power Pivot

Power BI

Excel Expert
Level 0
Forum Posts: 15
Member Since:
May 6, 2022
sp_UserOfflineSmall Offline
4
October 18, 2022 - 3:22 pm
sp_Permalink sp_Print

Hi Mynda,

How would I do this in PQ?  

Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 202
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
5
October 19, 2022 - 12:35 am
sp_Permalink sp_Print

In PQ highlight your 3 AV click add column>in the group "From Number", Standard>Add. Do the same for your PV columns. Highlight your AV & PV columns and in that same dropdown would be a subtract. You can then delete your unneeded helper columns. Yes, there are other ways to do it, but that's using the built-in functions.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4446
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
October 19, 2022 - 8:15 am
sp_Permalink sp_Print

Hi Anita,

I think Jessica is picturing the data in PQ is in separate columns as it appears in your screenshot, but presumably you have one column called channel. If so, you can add a new custom column with an 'if' statement to determine if the channel column contains 'AC' or 'PV' and return the tag accordingly.

You can then use this new column in a PivotTable to summarise the kW Demand and add a calculated column to take one from the other.

Mynda

sp_AnswersTopicAnswer
Answers Post
Avatar
Anita Payet
Member
Members

Dashboards

Power Query

Power Pivot

Power BI

Excel Expert
Level 0
Forum Posts: 15
Member Since:
May 6, 2022
sp_UserOfflineSmall Offline
7
November 27, 2022 - 5:14 pm
sp_Permalink sp_Print

Thanks Mynda,

You are correct.  I have once column called 'channel'.  What you suggested has worked.

Anita.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Andy Kirby, MohamedGadAllah, Jeff Krueger, RAMEZ ATTAR, Kylara Papenfuss, Vincent Malone II
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.