Replace Blank Values with Zero in Power BI Matrix Visual

One of my colleagues was working on a Power BI report, where some of the values in his matrix visual were showing up as blank. From a user’s point of view, blank cells can be confusing. So, we needed to show zero instead of blank in the matrix visual.

In this Power BI tutorial, I’ll show you three simple ways to replace blank values with zeros in the Power BI Matrix visual:

  • With the help of the COALESCE Function in Power BI
  • Using the Power BI ISBLANK Function
  • Using Power Query Editor in Power BI

Method 1: Replace Blank with Zeros in Power BI Matrix using COALESCE Function

For the first method, I will use the COALESCE function in Power BI to replace blank cells in the matrix with zeros.

The screenshot below displays a Matrix visual with ‘Sales’ data, where the Row fields: Category and Product, along with the Columns: ‘Year‘ and Values represented as ‘Sales Quantity‘.

From the matrix, you can see that it includes blank values for[ Keyboard (2024)] and [Laptop (2025)].

Replacing Blank with 0 Value in Matrix Power BI

Now, I wanted to show zeros instead of blank values in the above-shown Power BI matrix.

To achieve this, we need to create a Power BI measure using the COALESCE function. You can check an article on creating a measure in Power BI.

Now follow the steps below:

  1. On the Power BI report canvas, click on the matrix visual that is showing blank values. In my case, I selected the matrix that displays:
    • Rows: Category, Product
    • Columns: Year
    • Values: Quantity
Replace Blank Values with Zero in Power BI Matrix Visual
  1. Then, from the Home tab, click on the New Measure icon to create a measure. It navigates to another window, where you can add a Measure. Provide the expression placed in the code below.
Blank Quantity = COALESCE(SUM(ProductSales[Quantity]), 0)

Replace ‘ProductSales[Quantity]‘ with your data column name.

Show Zeros instead of Blank Power BI Matrix
Power BI matrix show 0 instead of blank
  1. After that, click on the Report view. From the Visualization pane, replace the value with the measure you created.
Power BI matrix display 0 instead of blank
  1. Now, you can see that the blank values present in a matrix are replaced with zeros. Have a look at the reference image.
Display Blank with Zeros in Power BI Matrix

This is how to replace blanks with zeros in a matrix visual in Power BI.

Check out: Display Excel Spreadsheet in SharePoint Online

Method 2: Replace Blank with Zero in Matrix Power BI using ISBLANK Function

Let me consider the same example using another function, specifically the ISBLANK function.

As you already saw, the matrix visual includes blank values. Here, I will place the screenshot again for your reference.

Display 0 instead of blank in Power BI Matrix

Now, I wanted to display the zeros instead of blank cells in the matrix shown above.

Here, I will create a new measure using the ISBLANK function and then replace the value with the newly created measure.

  1. On the Power BI Home page, click on New Measure and create a measure with the following expression.
Product Quantity Zero = IF(ISBLANK(SUM(ProductSales[Quantity])),0, SUM(ProductSales[Quantity]))

From the expression, replace ‘ProductSales[Quantity]‘ with your data column name.

Display zero instead of blank in matrix Power BI
  1. Then, replace the created measure in the Value field of the Visualization pane, as shown in the image below.
Replace Power BI matrix blank values with Zero

Output:

Power BI Blanks to Zeroes in a Matrix

Learn More: Display Average Instead of Total in Power BI Matrix Visual

Method 3: Display Zero Instead of Blank in Power BI Matrix

We can also display blank values as zero by using the Transform data option in the Power BI Matrix.

Suppose you have created a Matrix visual as shown in the image below, which consists of blank values, and you want to replace them with zeros.

Replace Blank as Zero Power BI Matrix

See the steps mentioned:

  1. On the Home tab of Power BI desktop, click on the Transform data option.
Replace Blank Values with Zero in Power BI Matrix Visuals
  1. It navigates to the Power Query editor, where you can select the data table that is connected to the Matrix.
  2. Select the column where you have blank values [Quantity]. Then, select the “Replace Values” option, located under the Home tab.
Replace Blank with 0 in Power BI Matrix
  1. Next, the Replace Values pane opens up, configures the following properties, and then clicks the OK button.
    • Value to Find: Enter null.
    • Replace With: Provide ‘0’.

Then, click the Close & Apply icon located at the top left side of the window.

Display zero instead of blank Power BI matrix

Output:

Power BI Show Blanks to Zeroes in Matrix

This way, you can show zeros instead of blank values in the Power BI Matrix visual.

From this tutorial, you have learned how to replace blank values with zeros (0) in a matrix visual in Power BI using three different methods. I hope you find this article informative. Please feel free to leave your suggestions and queries in the section below.

Read More About Power BI Matrix:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…