+ Reply to Thread
Results 1 to 7 of 7

How to get the column label in a pivot ?

  1. #1
    Registered User
    Join Date
    02-20-2016
    Location
    Belgium
    MS-Off Ver
    V2013
    Posts
    4

    How to get the column label in a pivot ?

    Hello,

    I have a pivot table with column labels YearMonth values (eg 202101, 202102) and row labels CustomerNames. The values in the table are the sales amounts.

    To get the maximum value of the monthly sales I add a calculated item MaxSales as an additional column with formula =MAX('202101','202102','202103'). That works perfect and for each CustomerName row I get the MaxSales figure.

    Now I try to add another additional column that contains the YearMonth of the MaxSales, in other words that contains the column label value of the month in which the MaxSales is realized.

    However, I do not succeed. Is it technically possible or is this a limit of pivot tables ? As Excel knows to find the MaxSales it should know where it found it and should be able to look up and return the associated YearMonth. Does anyone knows the trick to solve this ?

    Many thanks.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: How to get the column label in a pivot ?

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-20-2016
    Location
    Belgium
    MS-Off Ver
    V2013
    Posts
    4

    Re: How to get the column label in a pivot ?

    Attachment added
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: How to get the column label in a pivot ?

    With power query, here is a solution that shows max sales by monthyear and monthyear by customer.
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: How to get the column label in a pivot ?

    crossposted: https://www.mrexcel.com/board/thread...pivot.1166261/

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

  6. #6
    Registered User
    Join Date
    02-20-2016
    Location
    Belgium
    MS-Off Ver
    V2013
    Posts
    4

    Re: How to get the column label in a pivot ?

    Does the attached file contains the solution example ? When I open it, I don't see a difference with the original.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: How to get the column label in a pivot ?

    Apologize. Forgot to save file before closing and uploading. Will work on this tonight. No time during the day today.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Bring Column labels dynamically to pivot table as the column label is changed
    By JAIGANESH308 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-12-2016, 05:26 AM
  2. Column label format after pivot refresh
    By Robby Meersman in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 01-29-2014, 08:40 AM
  3. Replies: 1
    Last Post: 09-30-2013, 09:52 AM
  4. Replies: 11
    Last Post: 07-18-2013, 05:14 PM
  5. Changing Pivot Column Label with Marco
    By mhraja in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2013, 02:51 PM
  6. Manipulating a Column Label Filter on a Pivot using VBA
    By abhi.ko in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2011, 06:04 PM
  7. Linking column label in Pivot table
    By James_SF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2011, 10:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1