Forum

Don't plot zero val...
 
Notifications
Clear all

Don't plot zero values in line chart

4 Posts
2 Users
0 Reactions
103 Views
(@thembrow)
Posts: 4
Active Member
Topic starter
 

Is it possible to stop line charts plotting zero values?

 
Posted : 12/12/2019 4:57 pm
(@mynda)
Posts: 4762
Member Admin
 

Hi Oracle!

Write a measure that sums the values and where the result is =0, return BLANK() e.g.

Line Chart Values = IF(SUM(FactTable[Sales])=0, BLANK(), SUM(FactTable[Sales])) 

Use this measure in the Values area for your line chart.

Mynda
 
Posted : 12/12/2019 8:12 pm
(@thembrow)
Posts: 4
Active Member
Topic starter
 

Hi Mynda

Thanks for that. I had tried Blank() and "".

Here is my logic:

Average Weight = if(sum(Kill[Head])=0,BLANK(),AVERAGEX(kill,sum(Kill[Kilograms])/sum(Kill[Head])))
 
Here is the result of that logic:
[Image Can Not Be Found]C1.JPG
And the resulting chart:
C2.JPG
 
Between weeks 6 and 40 in the south and weeks 6 and 23 in the north, there is no trading but the line chart interpolates between those weeks.
 
Oracle
 
Posted : 12/12/2019 10:16 pm
(@mynda)
Posts: 4762
Member Admin
 

Yes, that's how line charts plot missing data and I'm not aware of any option to change it. The reasoning being that you need two points to create a line, if you have dates either side of a point without data, then you have no line. 

If you don't want those points plotted then I recommend you change it to a column chart or use the combo chart that allows one series to be a line and the other to be a column chart. The tops of the columns can still be easily interpreted as a line. 

 
Posted : 12/12/2019 10:40 pm
Share: