OpenBI Docs Buy

ALLSELECTED

A table's rows or columns' values as the filters from outside the visual leave them (slicers, the page), ignoring its own rows and columns.

Group: Filter. Compatible with DAX.

Syntax

ALLSELECTED ( <tableName> )
ALLSELECTED ( <columnName> [, <columnName>] … )
ALLSELECTED ( )
ParameterTypeDescription
tableNameTableA table whose filters go back to what the visual's surroundings set.
columnNameColumn
repeatable
A column treated the same way; several may be given.

Returns

Table. As a filter, the filters from outside the visual put back; as a table, the values they leave.

Remarks

  • In a visual, each cell is filtered by its own row and column, and all cells by the slicers and the page. ALLSELECTED removes the first kind and keeps the second, so a share computed with it adds up to the whole of what the reader has selected.
  • In a query, the filter tables of SUMMARIZECOLUMNS and the filters of an outer CALCULATETABLE play the part of the slicers.
  • ALL ignores the selection as well. Use ALL for a share of everything, ALLSELECTED for a share of what is selected.
  • With no argument, it does this for every table at once, as a filter of CALCULATE.
  • It refers to the filters around the visual or the query. Inside iterations a measure runs on its own, the result is harder to predict: keep it to measures shown in a visual.

Examples

A share of the selection and a share of everything

The filter table stands for a slicer with Pils and IPA picked.

EVALUATE
SUMMARIZECOLUMNS (
    Products[Product],
    FILTER ( ALL ( Products[Product] ), Products[Product] = "Pils" || Products[Product] = "IPA" ),
    "Liters", [Liters sold],
    "Share of selected", DIVIDE ( [Liters sold], CALCULATE ( [Liters sold], ALLSELECTED ( Products[Product] ) ) ),
    "Share of all", DIVIDE ( [Liters sold], CALCULATE ( [Liters sold], ALL ( Products[Product] ) ) )
)
ORDER BY Products[Product]
Products[Product]LitersShare of selectedShare of all
IPA3318840.24837712634990.183720341905702
Pils10043260.75162287365010.555962674021001

The selected districts, by category

Two districts are selected. ALLSELECTED removes the district of each row but keeps its category, so each row shows its category's liters in both districts.

EVALUATE
SUMMARIZECOLUMNS (
    Products[Category],
    Places[District],
    FILTER ( ALL ( Places[District] ), Places[District] = "Frogner" || Places[District] = "Storo" ),
    "Liters", [Liters sold],
    "In the selected districts", CALCULATE ( [Liters sold], ALLSELECTED ( Places[District] ) )
)
ORDER BY Products[Category], Places[District]
Products[Category]Places[District]LitersIn the selected districts
BeerFrogner148541279532
BeerStoro130991279532
CiderFrogner33796182
CiderStoro28036182

ALL, REMOVEFILTERS, CALCULATE, SUMMARIZECOLUMNS, ISFILTERED.

Last updated · OpenBI Studio 0.3.74