DAX KEEPFILTERS Function is categorized under Filter functions. KEEPFILTER is a filter modifier. KEEPFILTERS is necessary when you have arbitrarily shaped filters that you do not want to lose by applying additional filters on individual columns.
Purpose of DAX KEEPFILTERS Function
The KEEPFILTERS function modifies how filters are applied while evaluating a CALCULATE or CALCULATETABLE function.
The DAX KEEPFILTERS function doesnot return any value.
|expression||Any DAX expression.||Mandatory|
To override the standard behavior of CALCULATE and CALCULATETABLE functions, You can use DAX KEEPFILTERS function within the context of those function.
Any existing filters in the current context are compared with the columns in the filter arguments when you use KEEPFILTER and when the arguments intersects, the intersection is used as the context for evaluating the expression.
The net effect over any one column is that both sets of arguments apply −
- The filter arguments used in CALCULATE function.
- The filters in the arguments of the KEEPFILTER function.
In other words, while CALCULATE filters replace the current context, KEEPFILTERS adds filters to the current context.