13.7Blank values and division

You will see blank values in your visuals. A blank value is neither zero nor an error, even if, in some calculations, it behaves like zero. It means there is nothing, and Power BI draws behaviors from it that you need to know.

13.7.1BLANK

In Excel
Excel""
Match

You need it when a measure must show nothing, for example on the “Total” row of a table by city.

BLANK returns a blank value.

BLANK()
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table

It has no argument, but keeps its parentheses. In a table by city, you use it to show nothing, for example on the “Total” row:

Cities Revenue = IF( HASONEVALUE( Customers[City] ), [Revenue], BLANK() )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table
In plain words

“I want the revenue if only one city is left, and nothing otherwise.”

Table visual, The “Cities Revenue” measure by city
CityCities Revenue
New York900,000
Chicago500,000
Toronto300,000
Total

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

The city rows keep their number. The “Total” row stays blank.

Tip

Unless you change a setting, a visual hides the rows where all the measures are blank. A measure that returns BLANK() therefore makes rows disappear, while 0 would show them.

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 library already has a “Loans” measure, which counts the loans. In a table by genre, with the Books[Genre] column, the “Total” row must show nothing. Write the “Genre Loans” measure, with BLANK() for the total.

    Which formula should you write for “Genre Loans”?

  2. Combined useMeasureDifficulty

    A weather station finds an average misleading when it covers fewer than 3 readings. Write the “Reliable Average” measure, which returns the average of the Readings[Degrees] column when the “Readings” table has at least 3 rows, and a blank value otherwise.

    Readings
    DayDegrees
    7/1/202628
    7/2/202634
    7/3/202631

The rest of this lesson is part of izyDAX Pro

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