DAX Filter - ALLSELECTED function



Description

ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters.

This function can be used to obtain visual totals in queries.

Syntax

ALLSELECTED ([<tableName> | <columnName>])

Parameters

Sr.No. Parameter & Description
1

tableName

Optional.

The name of a table.

It cannot be an expression.

2

columnName

Optional.

The name of a column, usually fully qualified.

It cannot be an expression.

Return Value

The context of the query without any column and row filters.

Remarks

  • ALLSELECTED function takes one or no arguments.

  • If there is one argument, the argument is either tableName or columnName.

  • This function is different from the function ALL () because it retains all filters explicitly set within the query, and it retains all context filters other than row and column filters.

Example

SumTotal:= CALCULATE (SUM (Sales[Sales Amount]),ALLSELECTED ()) 
dax_functions_filter.htm
Advertisements