+ Reply to Thread
Results 1 to 7 of 7

Line graph with both values and percentage

  1. #1
    Forum Contributor
    Join Date
    07-06-2020
    Location
    zimbabwe
    MS-Off Ver
    Excel 365
    Posts
    468

    Line graph with both values and percentage

    Hi

    I'm kindly asking for help in constructing a line graph with both values and percentage. Please the attached excel sheet.

    Thank you.

    Regards,

    Sunboy
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Line graph with both values and percentage

    As you are using the 365 version of Excel, this proposal employs Get & Transform.
    1. Convert the range A4:F7 into an Excel table.
    2. Use the following Power Query advanced editor code to produce the table in columns H:J
    Please Login or Register  to view this content.
    3. Produce the pivot table in columns L:O from the Power Query table.
    Note: Years and category are placed in the Rows area and value is placed twice in the Values area. The second instance of value shows values as % of parent total based on the years field.
    4. A pivot chart is produced and the percent line is plotted against the secondary axis.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Contributor
    Join Date
    07-06-2020
    Location
    zimbabwe
    MS-Off Ver
    Excel 365
    Posts
    468

    Re: Line graph with both values and percentage

    Hi JeteMc

    Thank you for the genius graph formula.

    Regards,

    Sunboy

  4. #4
    Forum Contributor
    Join Date
    07-06-2020
    Location
    zimbabwe
    MS-Off Ver
    Excel 365
    Posts
    468

    Re: Line graph with both values and percentage

    Hi JeteMc

    Kindly asking you to also put the database2 on the same graph so that the graph will have database 1 and database 2 information so that I can compare them in one graph.

    Thank you.

    Regards,

    Sunboy

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Line graph with both values and percentage

    Turn both ranges into tables and give them distinctive names (I used Database1 and Database2).
    Open Get & Transform (Data tab) using Get Data > From Other Sources > Blank Query
    Paste the following into the Power Query Advanced Editor window:
    Please Login or Register  to view this content.
    In the pivot table Years and category are placed in the Rows area, Name is placed in the Columns area and value is placed twice in the Values area. The second instance of value shows values as % of parent total based on the years field.
    A pivot chart is produced and the percent line is plotted against the secondary axis.
    Let us know if you have any questions.

  6. #6
    Forum Contributor
    Join Date
    07-06-2020
    Location
    zimbabwe
    MS-Off Ver
    Excel 365
    Posts
    468

    Re: Line graph with both values and percentage

    Hi JeteMc

    Thank you for the graph formula.

    Regards,

    Sunboy

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Line graph with both values and percentage

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Replies: 1
    Last Post: 04-06-2021, 10:59 AM
  2. Updating existing 4 line graph is giving single line graph
    By carrach in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-15-2016, 07:53 AM
  3. Line Graph question - vetical line values at one fixed date
    By bohn in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-12-2015, 02:22 PM
  4. Unable to graph the desire x values on line graph..?
    By tigertan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2012, 05:04 AM
  5. Excel 2007 : Bar Graph to contain percentage values
    By Jaded in forum Excel General
    Replies: 1
    Last Post: 12-11-2011, 04:15 AM
  6. Displaying actual values on a percentage bar graph
    By BFlick11 in forum Excel General
    Replies: 9
    Last Post: 07-21-2011, 08:39 AM
  7. Percentage vs number values split on one graph
    By dominus_tuskus in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 05-10-2009, 07:16 PM

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