Power BI DAX COUNT function

The Power BI COUNT function is one of the DAX aggregate functions useful to count the total number of rows or records with non-blank values in a given column. This article explains the POWER BI DAX COUNT function to find the non-blank values and returns a whole number and the syntax of the COUNT function is shown below:

COUNT(<Column>)

The Power BI DAX COUNT function works on the numeric values, Dates, and string columns to count the rows.

  • It returns blank when there are no rows to count.
  • While counting the rows, if it finds blank rows, the COUNT function will skip them from counting.
  • This function does not support counting True/False values. However, you can use the COUNTA function.

Power BI DAX COUNT function Example

We need a Measure to work with the COUNT function and assign the result of the total records count. So, within the Home tab, click the New Measure button and rename it as ProductCount. To demonstrate the DAX COUNT() function, let me use the Product ID column from the SuperStore Orders to obtain the count of the total number of products. 

ProductCount = COUNT(Orders[Product ID])

Please add the new ProductCount Measure to the table report. For example, within the Furniture Category, there is a Bookcases subcategory which has a total of 232 products. Please refer to the Aggregate and the function article for the remaining Power BI functions. For more Charts >> Click Here.

Power BI DAX COUNT Function 1

The other option is to add the Product ID to the table and most likely it shows the count of products. If this is the case, click the down arrow beside the Product ID. Next, change the aggregation to Count as shown below.

Power BI DAX COUNT Function 2