Skip Zero in Graph

rahulbassi268

New Member
Joined
Sep 23, 2016
Messages
14
Hello All,

I am using Pivot Graph. In the pivot table, I had 2 columns: Entry Price & Current Price. The Bar was looking fine. But, I wanted to have Red bars for trades in Loss and Green for those in Profit.
So, for this, I added 2 calculated fields: LTP_Loss and LTP_Profit and hide that Current Price field as I no longer needed to display it.

I got the Red & Green color bars for Loss & Profit, but the zero is creating Problem.
The Zero is appearing as Gap and also as label hanging in the chart area...

My Calculated fields are as follows:
LTP_Loss = IF('Total Average Cost'>'Current Price','Current Price',0)
LTP_Profit = = IF('Current Price' >='Total Average Cost','Current Price',0)

I tried having space instead of Zero in the Else part of these formulae, but then the formulae return #Value

Please suggest.

Thanks.
Rahul
 

Attachments

  • Zero_Problem.JPG
    Zero_Problem.JPG
    54.7 KB · Views: 19

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hello All,

I was able to resolve this by simply changing the formatting of two columns in Pivot table to: 0;-0;;@
This way, these columns will display all data but zero.
So, in graph, those bars with zero are skipped.

Thanks
Rahul
 

Attachments

  • Zero_Solution.JPG
    Zero_Solution.JPG
    77.1 KB · Views: 19
Upvote 0
My Calculated fields are as follows:
LTP_Loss = IF('Total Average Cost'>'Current Price','Current Price',0)
LTP_Profit = = IF('Current Price' >='Total Average Cost','Current Price',0)

I tried having space instead of Zero in the Else part of these formulae, but then the formulae return #Value
Seems like you may already have a suitable solution but instead of zero in those formula you could try

= IF('Total Average Cost'>'Current Price','Current Price',NA())

Generally with graphs, #N/A values are ignored. If that works and you don't want the visual #N/A you could conditionally format the cell(s) to hide them.
 
Upvote 0
Seems like you may already have a suitable solution but instead of zero in those formula you could try

= IF('Total Average Cost'>'Current Price','Current Price',NA())

Generally with graphs, #N/A values are ignored. If that works and you don't want the visual #N/A you could conditionally format the cell(s) to hide them.
Hello Peter,

Thanks for your suggestion. I tried modifying my formula to below for 1 field:

LTP_Loss = IF('Total Average Cost'>'Current Price','Current Price',NA())

The table and graph starting displaying #NA.

So, I changed the option in Pivot options ("For error Values Show" checkbox). Then, the table started to hide #NA, but the graph still displayed zero.

Thanks
Rahul
 

Attachments

  • Zero_Solution_1.JPG
    Zero_Solution_1.JPG
    86.9 KB · Views: 10
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top