Home » DAX » DAX – COUNTBLANK Function

DAX – COUNTBLANK Function

COUNTBLANK DAX Function

COUNTBLANK DAX function is used to counts the number of blank cells in a column. This function comes under Statistical Functions DAX category.

Refer similar DAX : COUNTROWS , DISTINCTCOUNT COUNT, COUNTA & COUNTX

Syntax:

COUNTBLANK(<column>)




Description:

S no. Parameter Description
1 column The column that contains the blank cells to be counted.

Dataset format as below:

ID Amount Blank Boolean SalesDate Name
1 TRUE 29/5/2020 A
2 1000 FALSE B
3 2000 TRUE 29/5/2020
4 1000 FALSE 28/5/2020 C





Step-1: Now we will count number of Blank rows under “Blank” Column. So for this create one new measure.

COUNTBLANK = 
COUNTBLANK(SampleTable[Blank])

Above measure will return no of blank rows under “Blank” column is 4.

Step-2: Now try COUNTBLANK DAX with other columns

Count Blank with Amount Column:
COUNTBLANK = COUNTBLANK(SampleTable[Amount]) -----    Output = 1

Count Blank with SalesDate Column:
COUNTBLANK = COUNTBLANK(SampleTable[SalesDate]) ----- Output = 1

Count Blank with Id Column:
COUNTBLANK = COUNTBLANK(SampleTable[ID])

In id column there is no blank row so it will return Blank

Note:

The only argument allowed to this function is a column.

It will return a whole number. If no rows are found that meet the condition, blanks are returned.

Refer similar DAX : COUNTROWS , DISTINCTCOUNT ,  COUNT, COUNTA & COUNTX




Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.

Leave a Reply