Back to Roadmap
Level 1 — DAX Foundations+50 XP
Lesson 4
4. COUNT and COUNTROWS
Counting transactions vs counting values in a column.
The Concept
COUNT counts non-blank values in a column. COUNTROWS counts the number of rows in a table.
Example DAX:
// Best practice in Power BI for counting transactions: Total Transactions = COUNTROWS(Sales)
In Power BI development, COUNTROWS(Sales) is faster and semantically clearer than COUNT(Sales[SaleID]).
Try It Yourself
Create a measure 'Total Orders' that counts the number of rows in the Sales table.
fx
[fx]COUNT and COUNTROWS=
Loading DAX Formula Studio...
Type [ for fields