This demo illustrates the different count functions you can write in Power BI. On how to summarize and count data without DAX visit: summarizing data in Power BI.
Counts up all the rows in a given column
Define a measure to count all sales transactions:
number of sales = COUNT(TransactionData[Sales_Id])
Note: It will not count blank or empty rows.
Counts up all the rows in a given column.
Define a measure to count all sales transactions:
number of sales = COUNTA(TransactionData[region])
Note: It will not count blank or empty rows. Use COUNTA for text data types.
Counts up the number of rows in an expression, evaluated over a table.
Define a measure to count all sales transactions with revenue > $1000:
Number of sales w/ revenue > 1000 = COUNTX( FILTER(TransactionData,TransactionData[Revenue] > 1000), TransactionData[Revenue])
Recall: Functions with an X at the end, have a table as the first parameter and an expression as the second parameter.
Counts up the number of rows in an expression, evaluated over a table. Use with non-numeric data
Define a measure to count all rows where Ad Budget is "small" and Ad Source is "radio" in the advertising table:
CountData = COUNTAX( FILTER( Advertising, Advertising[Ad Budget] = "small" && Advertising[Ad Source] = "radio"), Advertising[Ad Budget])
Counts up the number of rows in a given column, where the rows are empty.
COUNTBLANK = COUNTBLANK(TransactionData[Region])
Counts up the number of rows in a table
count sales = COUNTROWS(TransactionData)
The above graphs gives an example on how you can apply COUNTROWS to extract valuable business information.