COUNT

Counts the number of rows in the specified column that contain non-blank values.

Quick Coach Video

What it does?

Counts the number of rows in the specified column that contain non-blank values.

Syntax

COUNT([Column])

Returns

A whole number.

What is the COUNT Function?

The COUNT function in DAX is like your party planner at a gathering—it counts up all the people (or items) in a list to give you a grand total. Whether you’re tallying attendees at an event or the number of products sold, COUNT is your go-to tool for getting that essential number!

Example 1: Concert Craze

Imagine you’re organizing a concert and need to know how many ticket types were sold. Here’s how your ticket sales data might look:

Tickets Table

Ticket Type

Tickets Sold

General Admission

120

VIP

45

Backstage Pass

15

To find out how many ticket types were sold in total, you’d use the COUNT function like this:

Total Ticket Types Sold = COUNT(Tickets[Tickets Sold])

So how many tickets did you sell? 

Total Tickets Sold:

  • General Admission: 120
  • VIP: 45
  • Backstage Pass: 15

That’s a total of 3 ticket types counted! 🎤

Example 2: Library Loan Count

Picture this: you manage a library, and you want to find out how many books were checked out last month. Your check-out records might look like this:

Book Loans Table

Book Title

Times Checked Out

The Data Gatsby

1

To Analyze a Mockingbird

1

All Quiet on the Data Front

1

Pride and Data

1

To find out how many books were checked out, you’d use the COUNT function on the Times Checked Out column:

Total Types of Booked Checked Out = COUNT(Book Loans [Times Checked Out])

So, how many times were books checked out? Remember, this function counts the number of non-blank values in the Times Checked Out column. That's a total of 4 counts for checked-out books! 📚

 Conclusion: Count It Up!

The COUNT function in DAX is your reliable partner for getting a quick tally, whether it’s tickets at a concert, books in a library, or any other list you can think of. With just a simple function, you can transform data into useful insights and enhance your reports!

 

So, what are you waiting for? Let’s start counting! 🥳