ALLEXCEPT

The ALLEXCEPT function removes all context filters applied to the specified table except those that reference the columns included as arguments.

Syntax

ALLEXCEPT(
    <table>,
    <column>
    [,<column>
    [,...]]
)

Parameters
  • table: Table whose filters you want to remove.
  • column: Name of the column/s whose filters you want to leave.
Returned value

The ALLEXCEPT function returns a table.

Additional Information

The ALLEXCEPT function is useful for performing a calculation that affects all rows in a table regardless of the context of the calculation. It is usually used as an intermediate function in a calculation (usually as an argument in a CALCULATE function) to modify the set of rows on which it is to be performed. In practice -used as an argument in a CALCULATE function- it removes the filter from the context for all columns except those included as arguments.

One case in which its use is very useful is when we want to apply the ALL function to most of the columns of a table. In this case, it will be easier to use the ALLEXCEPT function to indicate the columns to which you do not want to apply the functionality offered by ALL instead of using the ALL function directly and having to add as arguments all the columns to which the functionality is to be applied.

It should be noted that if a new column is added to the table later, the function will also apply to it unless it is explicitly added to the argument list.

Examples

The measure

Total Sales = CALCULATE(FactSales[Sales], ALLEXCEPT(DimDate, DimDate[CalendarMonth]))

would calculate the sum of sales ignoring any filters that are being applied in the time dimension except those that refer to the month.

Category
Filter
Submitted by admin on Tue, 12/04/2018 - 12:10