ALLNOBLANKROW DAX Function (Filter)

Returns all the rows except blank row in a table, or all the values in a column, ignoring any filters that might have been applied.

Syntax

ALLNOBLANKROW ( <TableNameOrColumnName> [, <ColumnName> [, <ColumnName> [, … ] ] ] )
Parameter Attributes Description
TableNameOrColumnName

The name of an existing table or column.

ColumnName Optional
Repeatable

A column in the same base table. The column can be specified in optional parameters only when a column is used in the first argument, too.

Return values

Table An entire table or a table with one or more columns.

The result can include blank values if the table has blank values. The only blank that is not included in the result is the one added to the table in case of invalid relationships.

Remarks

This function removes the corresponding filters from the filter context. It does not materialize the resulting table when called directly in a filter argument of CALCULATE or CALCULATETABLE.

The only blank row that is ignored is the one added to a table in case of an invalid relationship. If the table contains blank values in columns, these values are included in the result.

» 4 related articles
» 3 related functions

Examples

The ALLNOBLANKROW function can be applied to either a table or a set of columns.

ALLNOBLANKROW ( Customer )

ALLNOBLANKROW ( Customer[Country], Customer[State] , Customer[City] )
--  
--  ALLNOBLANKROW still returns blanks, if they are present among the
--  regular rows of the table. The only blank ignored is the one in the
--  blank row
--
EVALUATE
ADDCOLUMNS (
    ALLNOBLANKROW ( Customer[Birth Date] ),
    "# Customers", CALCULATE ( COUNTROWS ( Customer ) )
)
ORDER BY [Birth Date]
--
--  If you need to remove blanks, you need to use either FILTER
--  or CALCULATETABLE to manually remove blanks.
--
EVALUATE
    ADDCOLUMNS (
        FILTER ( 
            ALLNOBLANKROW ( Customer[Birth Date] ), 
            NOT ( Customer[Birth Date] == BLANK () ) 
        ),
        "# Customers", CALCULATE ( COUNTROWS ( Customer ) ) 
    )
ORDER BY [Birth Date]

Related articles

Learn more about ALLNOBLANKROW in the following articles:

  • Avoiding circular dependency errors in DAX

    This article explains how DAX handles dependencies between tables, columns and relationships, to help you avoid circular dependency errors. » Read more

  • Blank row in DAX

    There are two functions in DAX that return the list of values of a column: VALUES and DISTINCT. This article describes the difference between the two, explaining the details of the blank row added to tables for invalid relationships. » Read more

  • Understanding Circular Dependencies in DAX

    This article explains how to avoid circular dependency errors that can occur in DAX when two or more entities (calculated columns or calculated tables) reference one another in such a way that the engine cannot compute their value. » Read more

  • Preparing a data model for Sankey Charts in Power BI

    This article describes how to correctly shape a data model and prepare data to use a Sankey Chart as a funnel, considering events related to a customer (contact, trial, subscription, renewal, and others). » Read more

Related functions

Other related functions are:

Last update: Nov 14, 2024   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://docs.microsoft.com/en-us/dax/allnoblankrow-function-dax

2018-2024 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of ALLNOBLANKROW? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.