ALL vs ALLEXCEPT vs ALLSELECTED vs REMOVEFILTERS in DAX
ALL, ALLEXCEPT, ALLSELECTED and REMOVEFILTERS reshape filter context inside CALCULATE — clear filters, keep some columns, respect outer visual selections, or remove filters with clear intent — the toolkit behind “% of total” measures.
Chala mitrano! After CALCULATE, the next interview cluster is the ALL family. Why? Percent of total is everywhere in business reports. How? We meet REMOVEFILTERS first (clearest), then ALL, ALLEXCEPT and ALLSELECTED with a FreshBasket (fictional) City example. One toolkit, four tools.
Quick answer
Vertical toolkit:
- Start from a solid
[Total Sales]. - REMOVEFILTERS ( column/table ) — clear those filters inside CALCULATE (modern, readable).
- ALL — classic “remove filters / return all values” building block.
- ALLEXCEPT — clear filters on a table except listed columns.
- ALLSELECTED — respect outer/visual selections when computing a partial total.
- Build one
% of all citiesmeasure with DIVIDE.
Pct = DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], REMOVEFILTERS ( … ) ) )
Why clear filters, rows in / number out
| City | Amount |
|---|---|
| Mumbai | 100 |
| Mumbai | 40 |
| Nashik | 80 |
- Matrix row = Mumbai. Rows in for
[Total Sales]: Mumbai only. Number out: 140. - Denominator for “% of all cities” must ignore the City on the row.
CALCULATE ( [Total Sales], REMOVEFILTERS ( Customer[City] ) )clears City. Rows in: all three. Number out: 220.DIVIDE ( 140, 220 )≈ 63.6%. That is Mumbai’s share of all cities.
Why each tool:
- REMOVEFILTERS — “drop this filter; keep the rest.” Clearest for beginners.
- ALL — classic sibling; can also return a table of all values.
- ALLEXCEPT — “clear the Customer table filters except Region.”
- ALLSELECTED — “percent of what this visual currently shows,” not always the whole universe.
ALL / ALLEXCEPT / ALLSELECTED / REMOVEFILTERS clear or reshape filter context — the toolkit behind “% of total” patterns.
मित्रांनो — ALL / ALLEXCEPT / ALLSELECTED / REMOVEFILTERS clear or reshape filter context — the toolkit behind “% of total” patterns.
मित्रों — ALL / ALLEXCEPT / ALLSELECTED / REMOVEFILTERS clear or reshape filter context — the toolkit behind “% of total” patterns.
What do I need before this guide?
Before and after (look at the tables first)
Before
आधी (Before)
पहले (Before)
After
नंतर (After)
बाद में (After)
REMOVEFILTERS (learn this early)
Sales All Cities =
CALCULATE (
[Total Sales],
REMOVEFILTERS ( Customer[City] )
)
Adjust table/column names to your model. Meaning: evaluate Total Sales as if City were not filtered.
ALL (classic sibling)
ALL ( table ) drops filters on that table; ALLEXCEPT keeps listed columns filtered and clears the rest on that table.
मित्रांनो — ALL ( table ) drops filters on that table; ALLEXCEPT keeps listed columns filtered and clears the rest on that table.
मित्रों — ALL ( table ) drops filters on that table; ALLEXCEPT keeps listed columns filtered and clears the rest on that table.
ALL ( Customer[City] )/ALL ( Customer )patterns clear filters and can return tables of values.- Many older examples use ALL inside CALCULATE for the same “ignore filter” idea.
- REMOVEFILTERS is often clearer when you only want to drop filters.
ALLEXCEPT
-- sketch: keep Region filters, clear other filters on the table
CALCULATE (
[Total Sales],
ALLEXCEPT ( Customer, Customer[Region] )
)
Use when you must preserve one (or more) column filters while clearing the rest on that table.
ALLSELECTED
ALLSELECTED respects outer visual selections; REMOVEFILTERS is the clearer modern way to drop filters on columns/tables.
मित्रांनो — ALLSELECTED respects outer visual selections; REMOVEFILTERS is the clearer modern way to drop filters on columns/tables.
मित्रों — ALLSELECTED respects outer visual selections; REMOVEFILTERS is the clearer modern way to drop filters on columns/tables.
- Useful for “percent of what the visual currently shows”.
- Respects outer selections more carefully than a blunt ALL on everything.
- Practise after you can write one REMOVEFILTERS denominator confidently.
Tiny % of total pattern
Pct of All Cities =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], REMOVEFILTERS ( Customer[City] ) )
)
- Numerator respects the City on the row/slicer (140 for Mumbai).
- Denominator clears City (220).
- Format as percentage.
Shop analogy: Mumbai’s share of the day’s till. Numerator = Mumbai drawer. Denominator = whole shop drawer.
Mistakes and calm fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Always 100% | Cleared nothing / wrong column | Remove the filter that the visual actually uses |
| Always blank | DIVIDE by zero / no rows | Protect with DIVIDE; check filters |
| Wrong % in matrix | Needed ALLSELECTED vs ALL | Compare both on a sample page |
| Too many ALL layers | Copy-paste stack | Rewrite one clear CALCULATE |
Ghabru naka 😅 — one working % measure beats five half-understood ALL calls.
Ravindra Bagale's Tip
Interview trap: “ALL vs REMOVEFILTERS?” Calm answer: “Both can clear filters; I prefer REMOVEFILTERS when I only need to drop filters inside CALCULATE — it reads cleaner.” Got it?
Ravindra Bagale's Tip – मराठी
Interview trap: “ALL vs REMOVEFILTERS?” शांत उत्तर: “दोन्ही filters clear करू शकतात; मी REMOVEFILTERS पसंत करतो जेव्हा CALCULATE मध्ये फक्त filters drop करायचे असतात — ते cleaner वाचते.” समजलं का?
Ravindra Bagale's Tip – हिंदी
Interview trap: “ALL vs REMOVEFILTERS?” शांत जवाब: “दोनों filters clear कर सकते हैं; मैं REMOVEFILTERS पसंद करता हूँ जब CALCULATE में सिर्फ filters drop करने हों — वो cleaner पढ़ता है.” समझ में आया?
Practice task
- Build Sales All Cities with REMOVEFILTERS (expect 220 on the sample).
- Build Pct of All Cities with DIVIDE.
- Put City on a matrix + the % measure (Mumbai ≈ 64%).
- Write which filters still applied to the denominator.
- Skim ALLSELECTED examples in the course without rushing.
Got it? REMOVEFILTERS/ALL clear filters; ALLEXCEPT keeps listed columns; ALLSELECTED respects outer visuals. One % measure is enough practice. Next: RELATED. Let's continue.
समजलं का? REMOVEFILTERS/ALL clear filters; ALLEXCEPT keeps listed columns; ALLSELECTED respects outer visuals. One % measure is enough practice. Next: RELATED. आता पुढे जाऊया.
समझ में आया? REMOVEFILTERS/ALL clear filters; ALLEXCEPT keeps listed columns; ALLSELECTED respects outer visuals. One % measure is enough practice. Next: RELATED. आगे बढ़ते हैं.
Frequently asked questions
What does ALL do?
Removes filters from a table or column (and returns all row values of that table/column in many uses) — classic “ignore this filter” building block.
What does REMOVEFILTERS do?
A clearer function to remove filters on tables/columns inside CALCULATE without implying you need the ALL table result.
What does ALLEXCEPT do?
Removes filters from a table except for the columns you list — keep Region, clear other Sales filters, for example.
What does ALLSELECTED do?
Returns values as filtered by outer/visual selections — often used for percent of what the user currently sees.
Which should beginners learn first?
REMOVEFILTERS (or ALL on one column) inside CALCULATE for a simple “% of all cities” card.
Course lesson?
ALL, ALLEXCEPT, REMOVEFILTERS, ALLSELECTED in the DAX chapter.