+ Reply to Thread
Results 1 to 8 of 8

Dynamic bar chart ignoring zero values

  1. #1
    Registered User
    Join Date
    05-17-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    Dynamic bar chart ignoring zero values

    Hello,

    I'm trying to create a dynamic bar chart using the sample data attached.

    Essentially what I'm trying to create is a dynamic bar chart that will:

    1. X-Axis: For the month of January only, show Jack, Mike, and Steve and the names of the fruits.
    2. Y-Axis: For the month of January only, show the number of fruits that correspond to each person.
    3. If there is no value listed (in this case zero blueberries, don't show it on the chart (including the legend). But if I enter a blueberry value, dynamically add this to the bar chart for the respective user.
    4. I'm then trying to create a slicer (or some type of selector) that will let me select the Month. So I'd like to see January as it's own bar chart, then once I select February, show the data for February only.

    Any help would be HUGELY appreciated! I've been trying to make this work but have not been able to get it.

    Attachment 574054
    Attached Files Attached Files
    Last edited by redsox786; 05-17-2018 at 02:55 PM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Dynamic bar chart ignoring zero values

    Hello,

    your data is laid out in a report format. This is really hard to use for the charts you want to create. You need to normalise your data into a flat table. Then you can use a pivot table to report on the data, grouping by the months, names or fruits as you desire.

    I suggest you load the data into Get and Transform, select the first two columns and then issue the command to unpivot OTHER columns. This will give you a flat table that you can save in a worksheet.

    Then build a pivot table with the data from that query.

    If you get stuck, sing out.

    cheers, teylyn

  3. #3
    Registered User
    Join Date
    05-17-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    Re: Dynamic bar chart ignoring zero values

    I'm not too familiar on the Get and Transform function and creating Pivot Tables

    Any chance you can help out by modifying the "Data.xlsx" sample worksheet?

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Dynamic bar chart ignoring zero values

    Here are the steps:

    - select a cell in the data
    - click Data > From Table/Range in the Get & Transform group
    - tick the box "My Table has headers" in the dialog and click OK
    - the Power Query Editor will open.
    - select the two columns Month and Name
    - in the Transform ribbon select the dropdown for Unpivot Columns and in there select "Unpivot Other columns"
    - now you will see the columns Month, Name, Attribute and Value
    - rename Attribute to "Fruit" and rename Value as you see fit or leave it as Value
    - In the right hand side panel rename the query from "Table1" to something more descriptive
    - On the home ribbon, click Close and Load
    - the four columns of data will now be loaded into a new sheet
    - click any cell in the new table and click Insert > Pivot Chart
    - drag the Name and the Fruit fields into the Axis (Categories) area and the Value field into the Values area
    - insert a slicer for Month

    See attached file.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-17-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    13

    Re: Dynamic bar chart ignoring zero values

    Thank you SO much Teylyn! This is a huge help.

    Just one follow up: Is it possible to exclude fruits from being plotted on the graph if the value is "0"? For example, Blueberries are zero across the board so I'm trying to avoid plotting them. But if I do decide to enter a value for blueberries for a user, can it automatically be plotted?

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Dynamic bar chart ignoring zero values

    You can add a step in the Power Query to remove rows with 0 values. Then they won't show up in the pivot chart.

  7. #7
    Registered User
    Join Date
    05-13-2018
    Location
    Sheffield
    MS-Off Ver
    Excel 2007 (Old I know)
    Posts
    7

    Re: Dynamic bar chart ignoring zero values

    Hello. Would this work for you? I have created a pivot chart which shows what you need.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-13-2018
    Location
    Sheffield
    MS-Off Ver
    Excel 2007 (Old I know)
    Posts
    7

    Re: Dynamic bar chart ignoring zero values

    Look at B1 and this should allow you to filter the month to show the chart you need
    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. [SOLVED] Dynamic Chart and Zero Values
    By RobJay in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 12-04-2015, 02:07 AM
  2. Dynamic Chart with Zero values
    By kasimagj in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-15-2015, 12:56 AM
  3. [SOLVED] dynamic chart values formula with dynamic starting point
    By Kramxel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2015, 03:30 AM
  4. [SOLVED] Data Cleanup - ignoring blanks, ignoring rows with string values etc.
    By Huyaku in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2015, 08:17 AM
  5. [SOLVED] Ignoring Values of Zero in a Pie Chart
    By cpalmer72 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-18-2014, 03:03 PM
  6. [SOLVED] Ignoring Null Values when Plotting an Excel 2003 Bar Chart
    By molson1973 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 02-18-2014, 06:11 AM
  7. Excel 2007 : Ignoring zero values on a pie chart
    By qaliq in forum Excel General
    Replies: 2
    Last Post: 02-13-2012, 08:21 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