DAX Filter - ALLSELECTED function


Advertisements

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

Useful Video Courses


Video

Mastering DAX and Data Models in Power BI Desktop

53 Lectures 5.5 hours

Abhay Gadiya

Video

Mastering DAX Studio

Featured

24 Lectures 2 hours

Randy Minder

Video

DAX / Power BI - Customer and Sales Analysis Deep Dive

26 Lectures 4.5 hours

Randy Minder

Advertisements