+ Reply to Thread
Results 1 to 13 of 13

How to compare 2 pivot tables in a single chart?

  1. #1
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    How to compare 2 pivot tables in a single chart?

    Hi,

    Hope all are well.

    Need a help.

    In attached file, sheet 2 contains 2 pivot tables - No. of batches Vs No. of tickets.

    I would like to compare both tables in a single chart.

    Ex. In month June, A produced 4 batches and raised 4 tickets. The comparison should reflect in a single chart. Similarly for others.

    Can someone please help?
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to compare 2 pivot tables in a single chart?

    In order to get two values into the same pivot chart, the two values need to be in the same pivot table.
    Since the two values come from different data sources, this requires some data modeling.

    I recommend doing some research on power query and power pivot, and using these to create your data model, and then inserting a pivot table from the data model, then a chart to the pivot table.

    How I would do this would be to load your two data sources into Power Query from a table and then Close & Load each as a connection, making sure to add both into the data model.
    These two will be your fact tables.

    You will need to create two dimension tables to create a relationship to your fact tables, one for month and one for site.
    I used Power Query to do that in your example.

    Then create the necessary relationships in the data model and insert a pivot table from the data model.

    You didn't mention what you wanted the chart to look like, so I just inserted a simple column chart.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    @63falcondude

    Many thanks for your help.

    The pivot table and chart you chose is definitely the one i want.

    However, i need this data in my original file but I didn't understand how to do it

    Can you please guide?

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to compare 2 pivot tables in a single chart?

    I briefly explained exactly how I did it in post #2.

    It requires knowing how to use Power Query and understanding data modeling, which requires more time to learn than I can give you in a forum post.

    You can see the Power Query steps that were taken by going to Data > Queries & Connection > then double clicking on any of the queries to open up PQ.

  5. #5
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    @63falcondude

    Many thanks for your help.

    Indeed it requires power pivot and power query knowledge. I tried doing by going through some posts but couldnt succeed.

    Do you mind combining the 2 pivot table in the attached file please
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    Hi all.

    Can the 2 pivot tables in file in my previous post be combined please (same as done in post # 2)

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: How to compare 2 pivot tables in a single chart?

    Please see attached.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    @63falcondude

    Many thanks.

    However, i just noticed a difference in thus file vs your previous file under relationships as shown in below pic.

    Attachment 841402

    Perhaps as a result, the slicers doesn't work properly. Can you please check?
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by rizwanulhasan; 09-02-2023 at 12:48 PM.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,040

    Re: How to compare 2 pivot tables in a single chart?

    Selecting attachment 841402 results in the following: "Invalid Attachment specified. If you followed a valid link, please notify the administrator".
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    My apologies. I have reuploaded now.

  11. #11
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    I tried creating the relationship but it leads to error. Sorry naïve at this. Can someone please help?

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,040

    Re: How to compare 2 pivot tables in a single chart?

    See if the following is what you want.
    1. Pulled Month from Calendar> More Fields into the rows area
    2. Used Month from Calendar> More Fields for the Month slicer
    3. Used Site from Site as the Site slicer
    Let us know if you have any questions.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    960

    Re: How to compare 2 pivot tables in a single chart?

    @JeteMc

    Thanks for the response.

    Unfortunately, slicer still doesn't work properly.

    For example, when CMO is selected under slicer "Pack Owner", it also shows other data.

    Also, i keep getting popup as shown in pic.

    Just to clarify, the common columns to be taken from both sheets are as below.


    Sheet Batches = Columns I, J, K

    Sheet Tickets - Columns D, T, U
    Attached Images Attached Images
    Attached Files Attached Files

+ 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 compare two pivot tables
    By Purr2250 in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 01-08-2023, 02:58 PM
  2. Plotting two tables on a single chart
    By Hiruy in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-23-2021, 09:56 AM
  3. how to compare two tables in a chart
    By akshay6s in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-05-2020, 09:26 AM
  4. Compare data in two pivot tables
    By TessK in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-12-2014, 11:15 PM
  5. Compare data in two different pivot tables
    By masben in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-07-2013, 05:19 PM
  6. Compare two lists using Pivot Tables?
    By Zaltec in forum Excel General
    Replies: 1
    Last Post: 03-05-2008, 04:52 AM
  7. How do I compare data in two pivot tables
    By brandysommerfel@discussions.microsoft.co in forum Excel General
    Replies: 1
    Last Post: 06-12-2006, 04:35 PM

Tags for this Thread

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