Microsoft Certified: Power BI Data Analyst AssociateModel the dataMedium

A data modeler is creating a Power BI report that compares product sales across different regions. The model contains a 'Sales' table, a 'Products' table, and a 'Regions' table. The 'Sales' table has a 'RegionID' column which is related to 'Regions[RegionID]'. The modeler needs to calculate the total sales for a specific product category (e.g., 'Electronics') but wants to see this total sales value for 'Electronics' repeated across all regions in a matrix visual, regardless of the region filter applied to other measures in the visual. Which DAX pattern effectively achieves this?

  1. ACALCULATE(SUM(Sales[SalesAmount]), ALL(Regions), Products[Category] = "Electronics")
  2. BCALCULATE(SUM(Sales[SalesAmount]), ALLEXCEPT(Regions, Regions[RegionName]), Products[Category] = "Electronics")
  3. CCALCULATE(SUM(Sales[SalesAmount]), ALL(Regions[RegionName]), Products[Category] = "Electronics")
  4. DCALCULATE(SUM(Sales[SalesAmount]), REMOVEFILTERS(Regions), Products[Category] = "Electronics")
Show answer & explanation

Correct answer: D. CALCULATE(SUM(Sales[SalesAmount]), REMOVEFILTERS(Regions), Products[Category] = "Electronics")

To ignore all filters coming from the 'Regions' table while applying a specific product category filter, REMOVEFILTERS(Regions) is the most precise choice. It removes all filters from the entire 'Regions' table, ensuring that the 'Electronics' sales are calculated across all regions without being affected by any region-specific slicers or visual filters.

Why the other options are wrong

  • A. ALL(Regions) would also work, as it removes all filters from the 'Regions' table. However, REMOVEFILTERS is often preferred for clarity when the intent is explicitly to remove filters.
  • B. ALLEXCEPT(Regions, Regions[RegionName]) would remove all filters from the 'Regions' table *except* for filters on 'RegionName', which is the opposite of the desired outcome (we want to ignore region filters).
  • C. ALL(Regions[RegionName]) would remove filters only from the 'RegionName' column, leaving other potential filters on the 'Regions' table in place, which might not fully achieve the goal if there are other columns in 'Regions' being filtered.

REMOVEFILTERS Function

A DAX function that removes all filters from a table or from specified columns, making it equivalent to ALL(). It is often preferred for its clear intent.

  • Equivalent to ALL() when removing all filters from a table.
  • Used within CALCULATE to modify filter context.
  • Ensures calculations are performed across the entire dataset or specific columns, ignoring external filters.

Memory trick: Remove filters to see the bigger picture.

More Model the data questions