• 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

Calculated field in Pivot Table|Power Pivot|Excel Forum|My Online Training Hub

You are here: Home / Calculated field in Pivot Table|Power Pivot|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 PivotCalculated field in Pivot Table
sp_PrintTopic sp_TopicIcon
Calculated field in Pivot Table
Avatar
Marko Tribl
Member
Members
Level 0
Forum Posts: 6
Member Since:
December 16, 2021
sp_UserOfflineSmall Offline
1
December 16, 2021 - 10:14 pm
sp_Permalink sp_Print

Hi,

I want to calculate item prices difference between two years.

Items are segmented by product group and quality group, divided by brands.

I have tried to add Calculated field in Pivot Table, but there is no option to choose price by year.

Thank you.

Best regards,

Marko

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
December 17, 2021 - 2:58 pm
sp_Permalink sp_Print

Hi Marko,

If you have proper dates in your model, which you should, then you can use the time intelligence functions like SAMEPERIODLASTYEAR etc. to find the price for the previous year and calculate the difference.

Mynda

Avatar
Marko Tribl
Member
Members
Level 0
Forum Posts: 6
Member Since:
December 16, 2021
sp_UserOfflineSmall Offline
3
December 17, 2021 - 9:38 pm
sp_Permalink sp_Print

Hi Mynda,

thank you for quick reply.

I have tried to implement function that you suggested, but with no result. I am not much familiar with DAX syntax.

Kindly ask you to check attached file with sample of data.

Thank you for support.

BR,

Marko

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
December 20, 2021 - 8:51 pm
sp_Permalink sp_Print

Hi Marko,

Thanks for sharing your file. There is an easier way. Simply right-click an of the values in the PivotTable > Show Values As > Difference From > Year and Previous.

Mynda

Avatar
Marko Tribl
Member
Members
Level 0
Forum Posts: 6
Member Since:
December 16, 2021
sp_UserOfflineSmall Offline
5
December 20, 2021 - 10:31 pm
sp_Permalink sp_Print

Hi Mynda,

thanks a lot.

When I want to create bar chart, is it possible to hide the columns for 2021? I would like to show only difference.

Best regards,

Marko

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
December 21, 2021 - 3:51 pm
sp_Permalink sp_Print

Hi Marko,

No, the PivotTable will always display the prior period and the chart will always display the data from the PivotTable. If you add a Slicer for the Brand you can then remove the legend and the chart will only display the brand selected in the Slicer. You can also set the series overlap to 100% and this will centre the bar to the InchSize label.

Hope that helps.

Mynda

Avatar
Marko Tribl
Member
Members
Level 0
Forum Posts: 6
Member Since:
December 16, 2021
sp_UserOfflineSmall Offline
7
December 21, 2021 - 7:39 pm
sp_Permalink sp_Print

Hi Mynda,

thanks for hints. It works great.

But I found out some other solution to work around the pivot table. I copied PT and past it as value, after that I created bar chart from this new table and edit source data to reference to my PT. I am not sure will it work in the future when my master table expand with new data.

I encountered on other difficulties now. How can I compare prices between two different brands for the same year?

Best regards,

Marko

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
8
December 21, 2021 - 9:52 pm
sp_Permalink sp_Print

If you've pasted the data as values then the chart won't reflect any updates to the PivotTable, so not ideal as you'd have to copy and paste as values each time you update the data.

You can also compare the brands using the Show Values As > Difference From setting.

Mynda

Avatar
Marko Tribl
Member
Members
Level 0
Forum Posts: 6
Member Since:
December 16, 2021
sp_UserOfflineSmall Offline
9
December 22, 2021 - 12:29 am
sp_Permalink sp_Print

Hi Mynda,

You are 100% right. I have tested in the meanwhile and chart does not reflect any updates to the PivotTable.

So I had to drop out this solution, because it is not efficient.

I have to dive in more in DAX formulas and syntax. It seems to me to be much more powerful than the regular excel formulas.

What do you think is it better to have multiple tables (each for one brand) connected in one table or to have one big table with all data in it (that is my case at this moment)?

I am thinking to create tables for each brand separately and after that to connect them through the data model. Maybe is easier to calculate some measures in this way.

Best regards,

Marko

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4515
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
10
December 22, 2021 - 10:18 am
sp_Permalink sp_Print

Hi Marko,

Definitely better to have one big table with all your data, than split it into separate tables for each brand. Having separate tables for each brand is not the way Excel or Power Pivot was designed to be used, so you will only come up against issues if you do that.

As I mentioned before, you can use Show Values As to calculate the difference between two different brands for the same year. See attached.

Mynda

Avatar
Marko Tribl
Member
Members
Level 0
Forum Posts: 6
Member Since:
December 16, 2021
sp_UserOfflineSmall Offline
11
December 22, 2021 - 10:39 pm
sp_Permalink sp_Print

Hi Mynda,

thank you so much for support and effort.

Best regards,

Marko

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 9
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: 216
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Melanie Ford
Isaac Felbah
Adele Glover
Hitesh Asrani
Rohan Abraham
Anthony van Riessen
Erlinda Eloriaga
Abisola Ogundele
MARTYN STERRY
Rahim Lakhani
Forum Stats:
Groups: 3
Forums: 24
Topics: 6355
Posts: 27792

 

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