COUNTBLANK
A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
In this article, we will explore the syntax and usage of the COUNTBLANK function and provide some practical examples to demonstrate its usefulness.
Syntax
The syntax for the COUNTBLANK function is simple. It takes a single argument, which is the column or expression you want to evaluate for blank or empty cells. Here is the basic syntax:
COUNTBLANK(❰expression❱)
Where `❰expression❱` is the column or expression you want to evaluate.
Examples
Let's take a look at some examples to see how the COUNTBLANK function works.
Example 1
Suppose you have a table that contains sales data for a particular month. The table has columns for the date, the salesperson, the region, and the amount of the sale. The table also has some missing data in the region column.
To count the number of missing values in the region column, you can use the COUNTBLANK function as follows:
= COUNTBLANK(Sales[Region])
This will return the number of blank or empty cells in the Region column of the Sales table.
Example 2
Suppose you have a table that contains data on employee attendance. The table has columns for the date, the employee name, and whether the employee was present or absent on that day.
To count the number of days a particular employee was absent, you can use the COUNTBLANK function as follows:
= COUNTBLANK(Attendance[Employee], Attendance[Absent])
This will return the number of days where the Absent column is blank or empty for a particular employee.
Example 3
Suppose you have a table that contains data on customer orders. The table has columns for the date, the customer name, the product name, and the quantity of the product ordered. The table also has some missing data in the quantity column.
To count the number of missing values in the quantity column for a particular product, you can use the COUNTBLANK function as follows:
= COUNTBLANK(FILTER(Orders, Orders[Product] = “Product A”), Orders[Quantity])
This will return the number of blank or empty cells in the Quantity column for the rows where the Product column equals "Product A".
In this article, we have explored the syntax and usage of the COUNTBLANK function in Power BI. This function is a powerful tool for quickly identifying missing data in a large dataset. By incorporating the COUNTBLANK function into your data analysis workflows, you can save time and ensure that your data is accurate and complete.