How to Show Zero Values in Power Bi Line Chart?

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

Moreover, we will see how not to show zero values in the Power BI line chart and show zero values when there is no data on the Power BI Desktop.

Here, we will cover the topics below:

  • Power BI line chart shows zero values
  • The Power BI line chart doesn’t show zero values
  • Power BI line chart shows 0 when no data

Power BI line chart: show zero values

Here, we will see how to show zero values when it is blank in the Power BI line chart.

For example, we will use the below Sales table, to show zero values in the Power BI line chart.

power bi line chart show zero values

In the above table, some of the values in the Sales Amount column are blank, so we will create a line chart to display sales Amounts based on the Date.

By default, it will ignore the blank rows and display the result like below.

power bi line chart show zero values

To show the blank values we will convert the blank values to zero, and then we will try to display them in the Power BI line chart. So it will look like below.

power bi line graph show 0 values

Follow the below steps to show 0 values in the Power BI line chart.

  • Open Power BI Desktop, then click on Excel workbook. Select the file from your local system.
  • Then, the navigator window will open; from here, select the table and click on the Load button.
power bi line chart do not show zero values
  • We will create a new measure, that will consider blank as zero value; for this click on the ‘New measure’. Then in the formula box, you can use any of the below measures:
Total Amount = IF(ISBLANK(SUM(Table1[Sales Amount])), 0, SUM(Table1[Sales Amount]))

or

Measure = CALCULATE(SUM(Table1[Sales Amount])) +0
power bi chart show zero values
  • Select the Line chart from the visualization pane to add the Line chart to Power BI Canvas.
power bi line chart show 0 values
  • Then drag and drop the Date and Total Amount or Measure to the X-axis field and Y-axis in the Power BI Desktop Line chart.
  • Then you can see it displays the Sales based on date and shows the zero value in the Power BI line chart.
power bi line graph don't show 0 values

This is how you can show the zero value in Power BI Desktop.

See also  How to read a text and count its occurrence from a docx file in Power automate?

Power BI line chart doesn’t show zero values

Here, we will see how to hide zero values from the Power BI line chart.

The above example demonstrates how to display zero values in a line chart using a measure. We can apply a filter to the visual to hide zero values in the line chart, ensuring that only non-zero data is displayed.

Even if your data contains zeros that you don’t wish to display in the Power BI line chart, you can achieve this by filtering the data to show only values that are not zero using the Filter pane.

Follow the below steps to show a non-zero value in the Power BI line chart.

  • In Power BI Desktop, we have created a line chart that will display the Total Amount [measure] based on Date.
power bi line chart don't show zero values
  • Then, in the Filter pane, under Filter on this visual -> expand the Total Amount section.
  • Then, under Show items when the value -> select is not from dropdown-> in box, write 0.
  • Click on the Apply filter.
power bi line chart don't show zero values
  • Now you can see the Power BI line chart doesn’t show zero values.
power bi line chart not showing zero values

This is an example of a Power BI line chart don’t show zero values.

Power BI line chart shows 0 when no data

Here we will see how to show 0 when there is no data in the Power BI line chart.

For example, we have created two tables i.e. Projects and Priority table, using the Enter data feature in Power BI.

Project

power bi line chart show 0 when no data

Priority

power bi line chart not showing all values

Then, Power BI automatically creates a one-to-one relationship between the tables. We will create a line chart in Power BI Desktop that displays the count of projects based on priority. It will appear as follows:

power bi line chart show 0 when no data

Here, you may notice that the line chart does not display the value “Medium” for priority as zero. This is because none of the projects in our Project table have the priority set to “Medium”.

See also  Power BI Measure multiply with examples

But we want to display 0 when there is no data in our table. For this, follow the below steps.

In Power BI Desktop, create a new measure. Then, in the formula box, write the formula below.

count of project = CALCULATE(COUNT('Projects'[Projects])) +0
show 0 when no data in power bi line chart

To create a line chart, from the visualization pane, select the line chart, and it gets added to Power BI Canvas.

Then, drag and drop the Priority and Count of Projects to the X-axis and Y-axis, respectively.

Now you can see the Power BI line chart shows 0 when there is no data for medium priority.

power bi show 0 when no data

This is how to show 0 when no data is available in the Power BI line chart.

To check all the solutions, you can download the zip file. Unzip it and open the .pbix file in Power BI Desktop.

Conclusion

In this Power BI tutorial, we saw how to show zero value in a Power BI line chart. Also, we cover the below topics:

  • Power Bi line chart show zero values
  • Power BI line chart doesn’t show zero values
  • Power BI line chart shows 0 when no data
  • Power bi line graph don’t show 0 values

You may also like:

>