Filter Functions Flashcards
ALLCROSSFILTERED(table)
Clear all filters which are applied to a table.
Can only be used to clear filters but not to return a table. Can be used only as a CALCULATE modifier and cannot be used as a table function.
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
REMOVEFILTERS([table | column[, column[, column[,…]]]])
Clear filters from the specified tables or columns.
PARTITIONBY ( partitionBy_columnName[, partitionBy_columnName [, …] ] )
Defines the columns that are used to partition a window function’s relation parameter.
ORDERBY ( orderBy_columnName[, order][, orderBy_columnName [, order]] [, …] )
Defines the columns that determine the sort order within each of a window function’s partitions.
CALCULATETABLE(expression[, filter1 [, filter2 [, …]]])
Evaluates a table expression in a modified filter context.
CALCULATE(expression[, filter1 [, filter2 [, …]]])
Evaluates an expression in a modified filter context.
ALLNOBLANKROW( {table | column[, column[, column[,…]]]} )
From the parent table of a relationship, returns all rows but the blank row, or all distinct values of a column but the blank row, and disregards any context filters that might exist.
KEEPFILTERS(expression)
Modifies how filters are applied while evaluating a CALCULATE or CALCULATETABLE function.
ALLEXCEPT(table,column[,column[,…]])
Removes all context filters in the table except filters that have been applied to the specified columns.
ALLSELECTED([tableName | columnName[, columnName[, columnName[,…]]]] )
Removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters.
INDEX(position[, relation][, orderBy][, blanks][, partitionBy])
Returns a row at an absolute position, specified by the position parameter, within the specified partition, sorted by the specified order. If the current partition can’t be deduced to a single partition, multiple rows may be returned.
OFFSET ( delta[, relation][, orderBy][, blanks][, partitionBy] )
Returns a single row that is positioned either before or after the current row within the same table, by a given offset. If the current row cannot be deduced to a single row, multiple rows may be returned.
FILTER(table,filter)
Returns a table that represents a subset of another table or expression.
ALL( [table | column[, column[, column[,…]]]] )
Returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table.
WINDOW ( from[, from_type], to[, to_type][, relation][, orderBy][, blanks][, partitionBy] )
Returns multiple rows which are positioned within the given interval.