In this post, we will learn How to show Zero values in Power BI Chart?

Why Power BI bar chart doesnโt show zero values?
If you try to use a Bar Chart in Power BI to display lookup values like (High, Medium, Low), you will notice that the lookup date labels will be displayed only if they have a corresponding value in the same table, as shown below:

However, if your table does not contain a row with a High value, you will notice that the Power BI bar chart does not display zero values, as shown below:

Actually, this is normal behavior; you can only display the stored value in your table; otherwise, the stacked bar chart cannot display any other values if it is zero!
How to show Zero values in Power BI Chart?
To show zero values in Power BI Chart for missing data, you have to do the following:
- Create a Lookup table for your values that you need to show.
- Manage the relationship between the new lookup table and the original table.
- Create a new measure that calculate the count of your values.
- In Stacked Bar Chart, Set the Axis, with the new status field in the lookup table.
Note: in case, you need to perfrom a custom sort order for your stacked bar chart, you have to check this article Power BI Custom Sort order in Bar Chart
1) Create a Lookup Table in Power BI
According to your requirements, you have to create a new lookup table that will contain the corresponding values that you need to display as follows:
- ID (A unique Identifier)
- Attribute (In our example, it will hold the correponding value for each status (High- Medium โ Low))
Steps
- At the โHomeโ tab, click on โEnter Dataโ to create a new table.

- The โCreate Tableโ should be opened now to add your lookup values.
- Add a column called โIDโ to serve as a unique identifier, and another called โStatusโ (or Attribute, if you want) to carry the corresponding values youโll need to sort it.
- Finally, set the Table name, and click Load to load the newly created table.

2) Manage Relationships in Power BI
Now, you just need to create a new relationship between the newly created lookup table and the original table as many to one by doing the following:
Steps
- At the left side, click on โModelโ Icon.
- From the above ribbon, click on โManage Relationshipsโ.
- Click on the โNewโ button to add a new relationship.

- At the first table, select the original table that holds the column you are need to sort.
- At the second table, select the newly created lookup table.
- Make sure that the columns have been mapped successfuly, and the โCardinalityโ is set to โMany to Oneโ, then click โOKโ.

3) Create a new measure
Now, you have to create a new measure that calculates the count of your values (In our example, we counts the number of projects)
Steps
- At โHomeโ tab, click on โNew Measureโ.

- Add the below formula to claculate the project count
count of project = CALCULATE(COUNT('Projects'[Project])) +0
4) Set Axis and Value Fields in Stacked Bar Chart
In the last step, you just need to
- Set the Stacked Bar Chartย Axisย field to the โStatusโ column that has been created in the new lookup table.
- Set the values to the newly created measure.

Great, the Stacked Bar Chart now shows zero value in Bar Chart in Power BI for missing data as shown below.

Conclusion
Finally, we learned how to display items with zero values in a Power BI Bar Chart by creating a new lookup table that represents all values even if they are not displayed in the main table.
Download
You can download the PIBX file atย Show Zero values in Power BI Chart, and donโt forget to followย Power BI Repoย to get more PIBX files samples with complex DAX formulas.
See Also
- Subscribe toย Power Platform Geeks
- Power BI Custom Sort order in Bar Chart
- Show items with no data as a Zero in Power BI
- Show items with no data in Power BI
- Have a related question? Please ask it at deBUG.to Community.