Forum

Need chart that sho...
 
Notifications
Clear all

Need chart that shows labels only for data points with values

8 Posts
2 Users
0 Reactions
61 Views
(@bk)
Posts: 7
Active Member
Topic starter
 

I need a chart that only shows the axis labels for cells that have data.

For example, in the attached file when Period 5 is selected in the slicer, I want the chart to only show the axis labels for Suppliers B, C, and D because they are the only suppliers in Period 5 that have data and the axis labels for Suppliers A and E to be hidden. Likewise, when Period 4 is selected, I want the "Supplier A" label to drop off because there is no data there.

I have tried using 0 and =NA() in the empty cells but the data labels still show up.

This is probably a very simple fix, but I am really struggling to figure it out.

 
Posted : 26/07/2019 10:39 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Brian,

You need to use a PivotTable to return the results you want to see in the chart. The Excel Table will always include suppliers that do or don't have data, whereas a PivotTable will only return suppliers that do have data.

Mynda

 
Posted : 26/07/2019 5:30 pm
(@bk)
Posts: 7
Active Member
Topic starter
 

Thanks, Mynda!

I am almost there. The data labels have dropped off but the chart still shows gaps where the labels with no data would be (if they had any data). Is there any way to make the chart more dynamic?

 
Posted : 27/07/2019 3:16 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Brian,

Without an example file I'm not sure exactly what you're referring to, sorry . If you're strictly talking about data labels and they show zero where there is no data, then you can use a custom number format to hide the zeros e.g

#,##0;-#,000;

The last semi-colon is the zero format, which is blank, therefore returning a blank data label.

Mynda

 
Posted : 27/07/2019 11:06 pm
(@bk)
Posts: 7
Active Member
Topic starter
 

Hi Mynda,

Sorry, I'm not explaining this very well. I have attached a file with a mock-up of what I am trying to do.

Thanks for your help.

Brian

 
Posted : 30/07/2019 7:41 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Brian,

Yes, you need to summarise your data in a PivotTable (not a table), but first you need to unpivot it, which I've done in the attached file with Power Query.

Mynda

 
Posted : 31/07/2019 9:48 pm
(@bk)
Posts: 7
Active Member
Topic starter
 

So I need to unpivot the data and include only the suppliers that have data in the table. That makes sense - I knew there had to be a simple solution!

Thanks so much!

 
Posted : 01/08/2019 9:43 am
(@mynda)
Posts: 4761
Member Admin
 

The PivotTable will automatically only include the suppliers that have data according to the filters set in the Slicer.

 
Posted : 01/08/2019 6:02 pm
Share: