Downloads
DAXFilter and contextAdvanced

ALLSELECTED

Returns the rows or values that remain after slicers and page filters, ignoring the visual's own row and column grouping.

Syntax
ALLSELECTED(<table> | <column> [, <column> ...])

Returns: A table. Inside CALCULATE, it removes the filters from the visual's own rows and columns but keeps the outside filters.

What it does

ALLSELECTED returns the items the user has selected, as a total across the visual. Inside a visual, each row or column of a matrix normally filters the measure down to that cell. ALLSELECTED lifts that row or column filter but keeps the slicers and page filters. The usual business use is percent of the selected total: the share of the visible categories or customers, which is what most readers expect when they slice a report.

Syntax and arguments

Example

Each product category's share of the categories the user has selected in the slicer.

Share of Selected Sales =
DIVIDE (
    [Total Sales],
    CALCULATE ( [Total Sales], ALLSELECTED ( Product[ProductCategory] ) )
)

In a table with one row per category, the denominator equals the total of the categories on screen. If a slicer selects only two categories, those two are the base, and their shares add up to 100 percent.

Example: a second use

The average sales per store, across the stores the user has selected.

Average Sales per Selected Store =
AVERAGEX (
    ALLSELECTED ( Stores[StoreName] ),
    [Total Sales]
)

The iterator visits each selected store, uses its total, and averages the results. A card with this measure shows the average for the selection, not for all stores.

Things to watch

In business terms

Percent of visible total for management reports, mix across the selected categories, and averages per selected branch or entity. Use it when a controller wants shares to add to 100 percent for whatever the page is showing.

Related functions

All DAX functions · View as Markdown · DAX fundamentals