Counting Blank Values in DAX Using COUNTBLANK

September 28, 2026 19 visits

In this article, we will learn how to identify and count blank values in individual columns using the COUNTBLANK function in DAX.

📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist

What Is COUNTBLANK in DAX?

COUNTBLANK is a DAX function used to count the number of blank values in a column. It is especially useful when you want to check the completeness of your data and identify columns containing missing values.

The basic syntax is:

DAX Syntax
COUNTBLANK(<Column>)

The function takes a column as its argument and returns the number of blank values found in that column.

Key takeaway:
COUNTBLANK counts blank values in a specified column and returns a single numeric value.

1. Inspecting the CountTable

Query

DAX Query
EVALUATE
    CountTable

Step-by-step explanation

Step 1: EVALUATE
EVALUATE is used to return the result of a table expression in a DAX query.

Step 2: CountTable
CountTable is the table expression being returned. This allows us to inspect the data before counting the blank values.

Why inspect the table first?

Before applying COUNTBLANK, it is useful to understand the source data and identify which columns may contain blank values.

Key takeaway:
Start by inspecting the source table so you can understand the columns and data that you are going to analyze.

2. Counting Blank Values in Multiple Columns

Query

DAX Query
EVALUATE
    ROW(
        "Col A", COUNTBLANK(CountTable[Column A]),
        "Col B", COUNTBLANK(CountTable[Column B]),
        "Col C", COUNTBLANK(CountTable[Column C])
    )

Step-by-step explanation

Step 1: EVALUATE
The EVALUATE statement returns the result of the table expression generated by ROW.

Step 2: ROW
ROW creates a table containing a single row. In this query, it is used to display the blank-value count for each column side by side.

Step 3: “Col A”
“Col A” is the name assigned to the first output column.

Step 4: COUNTBLANK(CountTable[Column A])
This expression counts the blank values in CountTable[Column A].

Step 5: “Col B”
“Col B” is the name assigned to the second output column.

Step 6: COUNTBLANK(CountTable[Column B])
This expression counts the blank values in CountTable[Column B].

Step 7: “Col C”
“Col C” is the name assigned to the third output column.

Step 8: COUNTBLANK(CountTable[Column C])
This expression counts the blank values in CountTable[Column C].

What will you get?

The query returns one row containing the blank-value count for each of the three columns.

Col A Col B Col C
Blank count Blank count Blank count

The exact numbers depend on the data available in your CountTable. The table above represents the structure of the query result.

Key takeaway:
Each COUNTBLANK expression returns the number of blank values in its respective column, while ROW combines those results into a single-row table.

3. Understanding COUNTBLANK

The important part of the query is the repeated use of COUNTBLANK:

COUNTBLANK Expressions
COUNTBLANK(CountTable[Column A])

COUNTBLANK(CountTable[Column B])

COUNTBLANK(CountTable[Column C])

Each expression follows the same pattern:

COUNTBLANK Pattern
COUNTBLANK(Table[Column])

You simply provide the column that you want to check, and COUNTBLANK returns the number of blank values in that column.

4. Why Use ROW with COUNTBLANK?

You could evaluate each COUNTBLANK expression separately, but using ROW allows you to place multiple results into a single query output.

For example:

Multiple Results in One Row
ROW(
    "Col A", COUNTBLANK(CountTable[Column A]),
    "Col B", COUNTBLANK(CountTable[Column B]),
    "Col C", COUNTBLANK(CountTable[Column C])
)

This produces a compact result that makes it easy to compare the number of blank values across multiple columns.

Key takeaway:
ROW is useful when you want to return multiple scalar calculations as columns in a single-row table.

Understanding the Query Flow

Part Purpose
EVALUATE Returns the table expression as the query result
ROW Creates a single-row table containing multiple results
COUNTBLANK Counts blank values in a specified column
“Col A”, “Col B”, “Col C” Names the output columns

Important Notes

1. COUNTBLANK works on a column

The argument passed to COUNTBLANK is a column, such as CountTable[Column A].

2. COUNTBLANK returns a number

Each COUNTBLANK expression returns a numeric count representing the number of blank values found in the specified column.

3. ROW returns the calculations together

Using ROW allows multiple blank-value counts to be returned together as columns in one result row.

4. The output column names are customizable

The names “Col A”, “Col B”, and “Col C” are output names. You can choose more descriptive names when writing your own query.

Descriptive Output Names
ROW(
    "Column A Blanks", COUNTBLANK(CountTable[Column A]),
    "Column B Blanks", COUNTBLANK(CountTable[Column B]),
    "Column C Blanks", COUNTBLANK(CountTable[Column C])
)

Practical Use Case: Data Quality Checking

Counting blank values is useful when performing data quality analysis. Before building reports or dashboards, you may want to understand whether important columns contain missing data.

For example, you can check multiple columns and quickly identify which columns contain more blank values. This can help you decide where additional data cleaning or transformation may be required.

📝 Practice Exercise

Try modifying the query to count blank values in additional columns from CountTable.

Then rename the output columns so that they clearly describe what each number represents.

For example, change:

Output Naming
"Col A", COUNTBLANK(CountTable[Column A])

to:

Descriptive Output
"Column A Blank Count", COUNTBLANK(CountTable[Column A])

Conclusion

In this article, we learned how to count blank values in DAX using COUNTBLANK.

  • COUNTBLANK counts blank values in a specified column.
  • ROW allows multiple calculation results to be returned together in one row.
  • EVALUATE returns the final table expression as the DAX query result.
  • You can use descriptive names for the output columns.
  • Counting blank values is useful for checking data completeness and data quality.

This simple pattern is a useful foundation for more advanced DAX data-quality and analysis queries.


📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist