ISEMPTY
Returns TRUE when a table has no rows in the current filter context.
ISEMPTY(<table>)Returns: TRUE or FALSE.
What it does
ISEMPTY answers the question "does this table have any rows here?" It is the test behind messages such as "No sales in this period" or "No returns to review." It returns TRUE when the table has zero rows and FALSE otherwise. It is the same test as COUNTROWS(...) = 0, and most people find it easier to read.
Syntax and arguments
- table: a table or a table expression, such as a table name,
FILTER(...)orCALCULATETABLE(...). It is evaluated in the current filter context.
Example
A status line that flags periods with no returns.
Returns Status =
IF (
ISEMPTY ( CALCULATETABLE ( Sales, Sales[ReturnAmount] > 0 ) ),
"No returns in this view",
"Returns to review"
)
CALCULATETABLE returns the return lines for the current filters. If there are none, ISEMPTY is TRUE and the first message shows. Otherwise the reviewer sees a prompt to look at the returns.
Example: a second use
Hide a card when there are no sales in the current view, rather than showing zero.
Sales Shown =
IF ( ISEMPTY ( Sales ), BLANK (), [Total Sales] )
When the filters leave no sales rows, the card is blank. Otherwise it shows the total.
Things to watch
- A table with rows that are all blank still has rows, so ISEMPTY returns FALSE.
- The test uses the filter context. Inside a matrix row, it tests only that row's slice.
- ISEMPTY works on tables. For a single value, use
ISBLANK. - Do not use it to test a measure's value. A blank measure is a value, not an empty table.
- Pair it with
IFto show a readable message instead of an empty visual.
In business terms
Exception reports: no returns, no open invoices, no bank transactions for a period, no journal entries for a close checklist item. It helps a dashboard explain a blank area instead of leaving readers to guess why it is empty.