Hein Thetard
Hein Thetard

Reputation: 37

Suppress zero values in Power BI Line graph

I am attempting to make a graph that has one column with a full month of data (black bars), and one column that fills up as the days of the month progress (green bars). I would also like to track the percentage of the forecast achieved each day as a line graph (red line) on the secondary axis.

The problem I am having is that it does not appear that one can exclude values that are zero. So in the graph I would like to have the red line disappear once the values become zero so that there isn't a massive drop of like in the image shown.

Graph showing the percentage drop of

Upvotes: 0

Views: 7640

Answers (1)

Hein Thetard
Hein Thetard

Reputation: 37

To fix this problem I inserted a blank spot if the condition is true. That is a "" after the 'then' statement to force a NULL. After this I changed the data type to percentage. The code is shown below and the resulting graph is shown afterwards.

= Table.AddColumn(#"Filtered Rows1", "AdjDiff", each if [#"%difference"] = 0 then "" else if [#"%difference"] <> 0 then [#"%difference"] else null)

Corrected Percentage Difference Line Graph

Upvotes: 1

Related Questions