• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Data Stories
    • Power BI Stories
    • 1 dataset, 100 matplotlib visualizations
  • Learning Portal
    • Download Center
    • 25 Days Challenge
    • DAX Glossary
    • Power BI
    • Power BI by Topic
    • Python
    • 1 dataset, 100 matplotlib visualizations
  • Courses
    • Power BI Mini Master Class 1: Using a REST API as a data source
    • Power BI Master Class 1: COVID Tracker
    • Introduction to Power BI – FREE Online course
    • M Language + Power Query Course Bundle
    • Power Query Online Training [updated 2022]
    • M Language Online Course: The unofficial and Practical Reference Guide [updated 2025]
    • My Courses
  • Shop
    • Courses
    • Master Classes
    • Template Apps
    • JSON Themes
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Search
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / KEEPFILTERS

KEEPFILTERS

posted on May 4, 2018

« Back to Glossary Index

Syntax

KEEPFILTERS(<expression>)

Tutorial with example

In today’s video we are going through the DAX function KEEPFILTERS.
KEEPFILTERS will remove the behaviour that CALCULATE has where it removes the filters available.

KEEPFILTERS and FILTER behaves quite similar, so the question is: when should you use them. You will find out at the end of the video.

DAX Fridays! #79: KEEPFILTERS

Download example file:

Download Power BI file: here.

 Related video on calculate:

DAX Fridays! #78: When should I use FILTER() with CALCULATE?

Remarks

You use KEEPFILTERS within the context CALCULATE and CALCULATETABLE functions, to override the standard behavior of those functions.

By default, filter arguments s in functions such as CALCULATE are used as the context for evaluating the expression, and as such filter arguments for CALCULATE replace all existing filters over the same columns. The new context effected by the filter argument for CALCULATE affects only existing filters on columns mentioned as part of the filter argument. Filters on columns other than those mentioned in the arguments of CALCULATE or other related functions remain in effect and unaltered.

The KEEPFILTERS function allows you to modify this behavior. When you use KEEPFILTERS, any existing filters in the current context are compared with the columns in the filter arguments, and the intersection of those arguments is used as the context for evaluating the expression. The net effect over any one column is that both sets of arguments apply: both the filter arguments used in CALCULATE and the filters in the arguments of the KEEPFILTER function. In other words, whereas CALCULATE filters replace the current context, KEEPFILTERS adds filters to the current context.

Was this helpful?
« Back to Index

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer CTA

Join our community of +50,000 professionals

Become a Member

Subscribe to YouTube

About me:

Curbal AB
Badhusgatan 7B
722 15 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2025 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In