0% found this document useful (0 votes)
32 views1 page

Allexcept Vs Keep Filters

ALLEXCEPT is a function that removes all filters from a specified table except for those specified, allowing for controlled filtering. KEEPFILTERS maintains existing filters while adding new ones, ensuring the context remains intact. The key difference lies in ALLEXCEPT resetting the filter context while KEEPFILTERS preserves it.

Uploaded by

vinaylakshman30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

Allexcept Vs Keep Filters

ALLEXCEPT is a function that removes all filters from a specified table except for those specified, allowing for controlled filtering. KEEPFILTERS maintains existing filters while adding new ones, ensuring the context remains intact. The key difference lies in ALLEXCEPT resetting the filter context while KEEPFILTERS preserves it.

Uploaded by

vinaylakshman30
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

ALLEXCEPT

Purpose: Removes all filters from a table except the ones specified.

Usage: Used to control which columns should retain their filters while clearing
others.

Syntax: ALLEXCEPT(table, column1, column2, ...)

Example:

CALCULATE(SUM(Sales[Amount]), ALLEXCEPT(Sales, Sales[Region]))

This would remove all filters from the Sales table except for the Region column.

KEEPFILTERS

Purpose: Ensures that existing filters are maintained, even if new filters are
added.

Usage: Used within a CALCULATE function to keep the existing filters and add new
ones.

Syntax: KEEPFILTERS(expression)

Example:

CALCULATE(SUM(Sales[Amount]), KEEPFILTERS(Sales[ProductCategory] = "Bikes"))

This would sum the Amount in the Sales table where ProductCategory is "Bikes",
keeping any existing filters intact.

Key Differences

ALLEXCEPT removes all filters from the specified table except the ones you specify,
effectively resetting the context for the table but keeping certain filters.

KEEPFILTERS maintains the existing filters and adds additional filters on top,
ensuring the existing context is not lost.

Practical Use Cases:

ALLEXCEPT: Useful when you need to compare values across a table while keeping one
or more specific filters.

KEEPFILTERS: Useful when you want to add additional filter criteria without
overriding the existing filters in the context.

You might also like