How to Show Zero Values in Power BI Bar Chart?

Do you want to show zero values in the Power BI bar chart? In this Power BI tutorial, we will see how to show zero values in the Power BI Bar chart.

Also, we have covered the below topics:

  • The power BI bar chart shows zero values
  • The power BI bar chart doesn’t show zero values
  • Power BI bar chart shows blank values

Power BI bar chart shows zero values

Here, we will see how to show zero values in the Power BI Bar chart.

For example, we have created a table i.e. Product table, using the Enter data feature in Power BI.

power bi bar chart show 0 values

In the above data table, you can observe that the price is null or blank for “mouse” and “mike”.

If we use this data to create a bar chart in Power BI Desktop to display the price based on product, it will only show the data for products with available prices.

Then, we can enable the option ‘Show items with no data’ to display “mouse” and “mike” in the chart.

We enable the Data label option in the Format pane to display zero values in the Power BI bar chart.

show 0 values  in power bi bar chart

Still, you can see that zero values are not reflected for the “Mouse” and “Mike” products. To address this issue, there are two ways:

  1. By creating a measure.
  2. Using the Power Query editor to replace the null values with 0.
See also  Power bi measure count with filter

If you use the “replace value” method, your data table will look like the one below. You can then directly create the bar chart and enable the data labels to see the zero values.

power bi bar chart show zero values

To use the measure method to display 0 values in a Power BI bar chart, follow the steps below:

  1. Open Power BI Desktop and create the above data table using the “Enter data” option.
  2. Select the Stacked bar chart from the visualization pane to create a bar chart.
  3. Next, click on the “New measure” button, then enter the following measure in the formula box.
Total Price = CALCULATE(SUM('Table (3)'[Price])) +0
power bi bar chart to show 0 values

Then, drag and drop the Total price and Product to the Y and X-axis, respectively.

power bi stacked bar chart show zero values

To show the values, click on the Format pane and enable the Data label option in Power BI Desktop.

Now, you can see the zero value in the Power BI stacked bar chart.

power bi stacked bar chart show 0 values

This is how to show zero value in the Power BI bar chart

The Power BI bar chart doesn’t show zero values

Here, we will see how to hide zero values in the Power BI bar chart.

For example, we have the sample table below, using the Power BI Enter data feature.

Microsoft power bi bar chart hide zero values

The provided data shows that the sales price for the “Mouse” and “Mike” products is 0. If we use this data to create a bar chart displaying the sales price by Product, it will include the products with a value of 0.

power bi bar chart don't show zero values

To hide “Mouse” and “Mike” in the chart, we need to filter the data i.e. Price not 0.

See also  Create PDF from Microsoft Forms via Power Automate

Let’s follow the below steps to hide the 0 value from the Power BI bar chart.

  1. Open Power BI Desktop, and create the above data table using the “Enter data” option.
  2. Select the Stacked bar chart from the visualization pane to create a bar chart.
  3. Next, drag and drop the Price and Product to the Y-axis and X-axis, respectively.
Microsoft power bi bar chart don't show zero values
  • Next, in the Filter pane, under Filter on the visual section, expand the Sum of Sales option.
  • Then, Show items when the value is not 0. Then click on the Apply filter.
Microsoft power bi bar chart hide 0 values

Now you can see the Power BI bar chart doesn’t show a 0 value.

power bi bar chart don't show 0 values

This is how to hide zero value from the Power BI bar chart.

Power BI bar chart shows blank values

Here, we will see how to show blank values in Power BI Desktop.

For example, we have created a table i.e. Product table, using the Enter data feature in Power BI.

power bi bar chart show blank values

In the above data, you can observe that the price is blank for “mouse” and “mike”.

If we use this data to create a bar chart that will display the price based on product, it will only show the data for products with available prices, as shown below.

Microsoft power bi bar chart show blank values

To display “Mouse” and “Mike” in the chart, we need to enable the option ‘Show items with no data’.

Let’s follow the steps below to show the blank values in the Power BI bar chart:

  1. Open Power BI Desktop, and create the above data table using the “Enter data” option.
  2. Select the Stacked bar chart from the visualization pane to create a bar chart.
  3. Next, drag and drop the Price and Product to the Y-axis and X-axis respectively.
show blank values Microsoft power bi bar chart

To show the blank values in the Power BI bar chart, right-click on the Product and then select the ‘Show items with no data‘ option.

show blank values power bi bar chart

Now you can see the Power BI bar chart shows the blank value in Power BI Desktop.

show blank values  in power bi bar chart

Conclusion

In this Power BI tutorial, we saw how to show zero value in the Power BI bar chart.

See also  How to do Error Handling in Power Automate?

Also, we covered these topics:

  • The power BI bar chart shows zero values
  • The power BI bar chart doesn’t show zero values
  • Power BI bar chart shows blank values

You may also like:

>