13.8Counting, finding the largest, replacing blanks

Beyond SUM and COUNTROWS, which you already know, a few functions count in other ways, find the largest or the smallest value, and replace a blank value.

13.8.1COUNT, COUNTA and COUNTBLANK

In Excel
DAXCOUNTCOUNTACOUNTBLANK
ExcelCOUNTCOUNTACOUNTBLANK
Match

You need them to check an extraction before you trust it, for example to find out whether some customer names are missing.

COUNT counts the non-blank values of a column of numbers, dates or text. COUNTA does the same, and also counts TRUE or FALSE values. COUNTBLANK counts the blank values.

The syntax of COUNT, COUNTA and COUNTBLANK
The non-blank valuesCOUNT( <column> )
With TRUE and FALSECOUNTA( <column> )
The blank valuesCOUNTBLANK( <column> )

Each one expects a single argument, a column written with its table, like Customers[Name].

  • COUNT( Sales[Qty] ) returns 12.
  • COUNTA( Customers[Name] ) returns 7.
  • COUNTBLANK( Customers[Name] ) returns a blank value.

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

Watch out!

All 7 customers have a name. So COUNTBLANK finds no blank value, and it returns a blank value, not 0. To show 0, write COALESCE( COUNTBLANK( Customers[Name] ), 0 ).

Unlike COUNTROWS, these three functions count within a column, not the rows of a table.

Practice

Each exercise is solved with the function you just discovered. Two exercises per function, a direct use and a combined use, from easiest to hardest, on data other than the course data. Pick the right formula out of five.

  1. Direct useMeasureDifficulty

    A class has handed in its papers. In the “Grades” table, the grade stays blank when the student did not hand in a paper. Write the “Papers Handed In” measure, which counts the grades in the “Grade” column.

    Grades
    StudentGrade
    Alma14
    Bilal
    Chloé9
    Dario17
    Eva

    Which formula should you write for “Papers Handed In”?

  2. Combined useMeasureDifficulty

    The teacher wants to know the share of papers handed in, among the students of the “Grades” table. A paper handed in has a grade in the “Grade” column. Write the “Hand-In Rate” measure.

    Grades
    StudentGrade
    Alma14
    Bilal
    Chloé9
    Dario17
    Eva
  3. Direct useMeasureDifficulty

    A sports club records in the “Members” table whether each membership fee is paid, with TRUE or FALSE. The column stays blank when it is not known yet. Write the “Known Fees” measure, which counts the filled-in values of the “Paid” column.

    Members
    NamePaid
    InèsTRUE
    HugoFALSE
    Jade
    KarimTRUE
  4. Combined useMeasureDifficulty

    The club wants to know for how many members it is still unknown whether the fee is paid. In the “Members” table, their value in the “Paid” column is blank. Write the “Unknown Fees” measure.

    Members
    NamePaid
    InèsTRUE
    HugoFALSE
    Jade
    KarimTRUE
  5. Direct useMeasureDifficulty

    A carrier tracks its parcels in the “Deliveries” table. The delivery date stays blank as long as the parcel has not arrived. Write the “Pending Parcels” measure, which counts the blank dates.

    Deliveries
    ParcelDelivery Date
    C-1013/2/2026
    C-102
    C-103
    C-1043/5/2026
  6. Combined useMeasureDifficulty

    The carrier wants to know the share of parcels still on their way, among all the parcels of the “Deliveries” table. A parcel on its way has no date in the “Delivery Date” column. Write the “Pending Share” measure.

    Deliveries
    ParcelDelivery Date
    C-1013/2/2026
    C-102
    C-103
    C-1043/5/2026

The rest of this lesson is part of izyDAX Pro

You have just read the first section. The next 2, their animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.