ALL and REMOVEFILTERS
Choose the denominator before choosing a function
A share measure divides a selected value by a deliberately defined total. Removing a category filter should not automatically remove a region filter. ALL(Products[Category]) can provide an unfiltered column table or act as a filter modifier inside CALCULATE. REMOVEFILTERS only clears filters; it cannot supply a table to an iterator. Use the narrowest necessary column to keep the rest of the business question intact. ALLEXCEPT(Products, Products[Category]) removes filters on the Products table except those directly placed on Category; it does not promise to reconstruct an implied category filter when only Product was selected. Table-level modifiers can have wider expanded-table effects in more complicated models.
Use the Chapter 24 isolated Import model described in labs/dax-filters-relationships/README.md. Sales has five synthetic lines totaling USD 200, Products has three unique product keys, Regions has North and South, and Dates has one row per day. Relationships filter from dimension to Sales; Dates[Date] to Sales[OrderDate] is active and Dates[Date] to Sales[ShipDate] inactive. The disconnected Selector table has North, South and West. No RLS, no DirectQuery, no other filters unless stated. Create each named measure individually in Desktop; calculated columns go on the specified table. Results are predictions, not observed native execution.
Example 1 — Market share within a region
Create the following measures separately. Format both shares as percentages rather than multiplying by 100. The denominator remains in USD.
Revenue = SUM(Sales[RevenueUSD])Region Revenue = CALCULATE([Revenue], REMOVEFILTERS(Products[Category]))Category Share = DIVIDE([Revenue], [Region Revenue])In a matrix with Category rows (no Product grouping) and a Regions slicer set to North, expected revenue is Home 30, Stationery 24, Travel 50, total 104. Home share is 30/104 = 28.85%; Stationery is 23.08%; Travel is 48.08% (rounded independently). The total is 100%. Change to South: Home 60, Stationery 36, Travel blank; denominator 96. A global share would instead remove region filters as well. The two definitions answer different questions.
Example 2 — Share of the visible selection
Visible Share =DIVIDE([Revenue], CALCULATE([Revenue], ALLSELECTED(Products[Category])))Keep North selected and restrict an external Category slicer to Home and Stationery. At the Home row, Revenue = 30, Category Share = 30/104, Visible Share = 30/54 = 55.56%. At Stationery, Visible Share = 24/54 = 44.44%. At the total row Visible Share = 1; Category Share = 54/104. Clearing the category slicer restores 104 as the selected denominator. ALLSELECTED in this simple matrix retains the outer selection and removes the category grouping; it is not a universal synonym for every visible row, especially inside nested iterators. Test it in the actual visual.
For a related variation, evaluate CALCULATE([Revenue], ALLEXCEPT(Products, Products[Category])) when both Category = Home and Product = Desk Lamp are directly filtered. It preserves Home but drops the Product restriction. In this tiny fixture the answer is unchanged because Home contains just one product; that is not true in general.
Avoid misleading totals
Removing filters from Sales or the whole model can also remove dimensions you intended to retain. Auto-exist can merge filters on columns of the same table to combinations that actually exist; clearing one column afterward need not restore every excluded combination. Do not promise that ALL always recovers a global denominator. Use separate dimensions where appropriate and test same-table slicers against expected totals. Neither ALL nor REMOVEFILTERS clears security filters imposed by RLS. The lab intentionally uses an unsecured synthetic model. DirectQuery restrictions for these functions in calculated columns and RLS rules differ from measure support; verify the exact host and function documentation.
Practice — State the scope
With North selected and Home and Travel selected externally, compute Home's Category Share and Visible Share, then predict the visible total row. Explain why clearing the region filter would answer a different question. Record numerator, denominator and percent separately. Check your work with the Chapter 24 lab; solutions are separate.
Further official reading
Microsoft Learn: all function dax · Microsoft Learn: allselected function dax · Microsoft Learn: removefilters function dax
These links provide supporting context; the local fixture and its expected results remain unchanged.