Filter Context Shaping

ALL vs ALLEXCEPT vs ALLSELECTED

See how each function changes the denominator in percentage-of-total calculations. This is where many Power BI reports go wrong: the numerator is fine, but the denominator is using the wrong filter universe.

Core Difference

% of Grand Total = DIVIDE([Sales], CALCULATE([Sales], ALL(Market[Country], Market[Category])))

ALL removes the specified filters and goes back to the full universe.

% Within Category = DIVIDE([Sales], CALCULATE([Sales], ALLEXCEPT(Market, Market[Category])))

ALLEXCEPT clears many filters but preserves one grouping.

% of Selected Total = DIVIDE([Sales], CALCULATE([Sales], ALLSELECTED(Market[Country])))

ALLSELECTED respects the outer selection but ignores the inner visual grain.

Visual Rows

Bright card = current matrix row

Percentage Denominators

Same numerator, different total universe

ALL

0%

Removes the row-level country and the selected category/year filters in this demo, returning to the full grand total.

ALLEXCEPT

0%

Keeps the category grouping, but removes year and country focus, so the denominator becomes total sales within the current category.

ALLSELECTED

0%

Respects outer slicers like category and year, but removes the current row grain. This is often what you want for visual totals.

When to use which

Practical report patterns

Use ALL when

  • You need a true grand-total baseline.
  • You want to ignore some or all filters on a table/column.
  • Typical use: percent of grand total, benchmark against full universe.
% of Grand Total := DIVIDE( [Sales], CALCULATE([Sales], ALL(Market)) )

Use ALLEXCEPT when

  • You want totals within one grouping, but not within lower-grain filters.
  • You want to preserve one key like Category, Year, or Customer Segment.
  • Typical use: percent within category, percent within year.
% Within Category := DIVIDE( [Sales], CALCULATE([Sales], ALLEXCEPT(Market, Market[Category])) )

Use ALLSELECTED when

  • You want the denominator to respect outer report/slicer selection.
  • You want matrix or chart rows to compare against the visible selected total.
  • Typical use: visual totals and percent of currently selected total.
% of Selected Total := DIVIDE( [Sales], CALCULATE([Sales], ALLSELECTED(Market[Country])) )

Common confusion

  • ALL can blow away slicer intent if used too broadly.
  • ALLEXCEPT preserves listed columns only, so be precise about the grouping you keep.
  • ALLSELECTED depends on outer selection context, so it is especially useful in visuals but can surprise people if they expect a true grand total.
Rule of thumb: use ALL for grand total, ALLEXCEPT for subtotal within one grouping, and ALLSELECTED for “percent of what the user currently selected”.