Menu
CoddyTech

Keeping Filters

Part of the DAX with CALCULATE section of Coddy's Power BI journey. Lesson 4 of 24.

A filter on a column replaces the visual's filter on it: every bar shows the same total.

KEEPFILTERS keeps the visual's filter and adds yours. A row must pass both.

Drinks Kept = CALCULATE([Revenue], KEEPFILTERS(Products[Category] IN {"Coffee", "Tea"}))

Bakery shows nothing: no row is both Bakery and a drink.

challenge icon

Challenge

Medium

Write Drinks Kept: Revenue for Coffee and Tea that keeps each bar's own category. It is checked for each category: Coffee and Tea show their own revenue, and the other categories drop out of the table.

Try it yourself

Drinks Kept =
CategoryDrinks Kept
Coffee
Tea
Bakery
Merch
Total
Fields
  • Sales
    • Revenue
    • Total Units
    • Customers
  • Products
    • ProductID
    • Product
    • Category
    • UnitPrice
    • UnitCost
  • Stores
  • Customers
  • Dates
  • Targets
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in DAX with CALCULATE