Dynamic Bar chart in Excel

Can someone please show me how to create dynamic  chart for the data attached here?  In the attached example, mint does not have any sales.  How can i build a dynamic chart that hides mint from the chart and only show mint sales on the chart when mint is not blank.
Book12.xlsx
LVL 1
fb1990Asked:
Who is Participating?
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Refer to the attached and see if this is what you were trying to achieve.
Book12.xlsx
0
 
Patrick MatthewsCommented:
Recast your source data to look like this:

Category      Product      Result
Percent Sales      cookie      42.64%
Percent Sales      sweets      84.75%
Percent Sales      dough      22.64%
Percent Sales      oil      20.00%
Percent Sales      biscuit      52.16%
Percent Rewards      cookie      48.10%
Percent Rewards      sweets      70.29%
Percent Rewards      dough      38.10%
Percent Rewards      biscuit      92.78%

Then create a PivotChart on that data, with Product as the Axis field, Category as the Legend field, and Sum of Result as the Value field
0
 
fb1990Author Commented:
Thanks Patrick and Neeraj.  Neeraj solution worked for me.  Is there a way to hide #N/A?  I want add data label and don't want that to show
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome.
#N/A is necessary to hide the series with no data in this case Mint sales.
0
 
fb1990Author Commented:
Thank you.  I added iferror to mask it and it changed the #N/A to 0%.  I want it to go away but i can live with it.  Thanks a a bunch as usual
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.