Forum Discussion
hide zero in bar chart
i want to hide 0 in bar chart as shown below, i tried below options but nothing is working
- removed zero from show blank and put space
- make font background white using condition measure_value=0 however all font values disappear in chart after applying this condition using Rules
- created measure for condition to display white for 0 else black and use Field Value for formatting however getting error
"this field cannot be used here because a matching data type is required power bi conditional formatting"
Please try either of these approaches, depending on whether you want to hide the zero labels or the bars.
1. Replace zero with BLANK()
Create a new measure:
Measure_Value_Display =
IF(
[Measure_Value] = 0,
BLANK(),
[Measure_Value]
)
Use this measure in the chart's Values field. Zero-value bars will disappear along with their labels.
2. Hide only the zero labels
If you want to keep the bars and hide only the 0.00 labels, create a color measure:
Label Color =
IF([Measure_Value] = 0, "#FFFFFF", "#000000")
Then go to Format visual → Data labels → Color → fx, select Field value, and choose Label Color.
This makes zero labels white while keeping the other labels black. It works as a workaround on a white chart background.
For reference, the snapshots below show how the chart looks after applying approaches 1 and 2 using the example above.
If this post helps, please accept this as a solution. Appreciate your kudos.
Thanks,
Pallavi
6 Replies
- pallavi_r
Super User
Please try either of these approaches, depending on whether you want to hide the zero labels or the bars.
1. Replace zero with BLANK()
Create a new measure:
Measure_Value_Display =
IF(
[Measure_Value] = 0,
BLANK(),
[Measure_Value]
)
Use this measure in the chart's Values field. Zero-value bars will disappear along with their labels.
2. Hide only the zero labels
If you want to keep the bars and hide only the 0.00 labels, create a color measure:
Label Color =
IF([Measure_Value] = 0, "#FFFFFF", "#000000")
Then go to Format visual → Data labels → Color → fx, select Field value, and choose Label Color.
This makes zero labels white while keeping the other labels black. It works as a workaround on a white chart background.
For reference, the snapshots below show how the chart looks after applying approaches 1 and 2 using the example above.
If this post helps, please accept this as a solution. Appreciate your kudos.
Thanks,
Pallavi
- nandeeshreddy32New Member
CY Label Color =
IF ( [CY Actuals USD] = 0, "#FFFFFF", "#404040" )
use this code instead - DaniyalKhaleel1
Resolver II
Create a display measure that returns BLANK() when the value is zero, then use it in the bar chart:
Display Value =
IF ( [Measure_Value] = 0, BLANK(), [Measure_Value] )
Replace [Measure_Value] with your measure and use Display Value in the chart.
This hides zero data labels while keeping non-zero values visible. If you need the bars themselves to remain visible, this approach works best when the measure is used for data labels and the original measure is used for the bar
- v-sathmakuri
Community Support
Hi powerbiexpert22 ,
Could you check the suggestion provided above and let us know if you have any additional queries?
Thanks!!
- sunilchauhan26Regular Visitor
what i see values are not 0 . those points have some value. if you change Display unit to None in Values section. it will show you original Value. That is is the reason why its appearing.
also if see other CY actual USD, it has actual zero value and its not appearing
- v-sathmakuri
Community Support
Hi powerbiexpert22 ,
Could you review the suggestion provided above and let us know if you have any additional questions, we are happy to address.
Thanks!!