ALL vs REMOVEFILTERS: Why Your % of Total Is Wrong
Percent-of-total measures go wrong in three predictable ways. What ALL and REMOVEFILTERS actually do, and which one you want for each kind of total.
Core Engineering Takeaways
- •As a CALCULATE modifier, REMOVEFILTERS and ALL do the same thing; REMOVEFILTERS just says so more clearly and cannot be used as a table function.
- •ALL on the fact table removes filters from every dimension related to it, so the denominator ignores your year and region slicers.
- •ALL on a single column leaves filters on other columns of the same table, which can make every row show 100%.
- •Use ALLSELECTED when the total should respect slicers but not the visual's own rows.
1. ALL and REMOVEFILTERS: the same, mostly
Inside CALCULATE, these two measures are equivalent:
Total All Products = CALCULATE ( [Total Sales], ALL ( 'Product' ) )
Total All Products = CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product' ) )Both remove filters from the Product table before evaluating [Total Sales]. The differences are about clarity:
REMOVEFILTERScan only be used as a filter modifier. It says exactly what it does.ALLis overloaded: as a modifier it removes filters, but it is also a table function that returns all rows of a table or all distinct values of columns, ignoring filters — for exampleCOUNTROWS ( ALL ( 'Product'[Category] ) ).
Using REMOVEFILTERS for the modifier case and ALL only when you need the table makes measures easier to read and review. But switching one for the other will not fix a wrong percentage — the bugs below are about what you remove filters from.
2. Bug 1: ALL on the fact table ignores your slicers
A very common first attempt:
% of Total =
DIVIDE ( [Total Sales], CALCULATE ( [Total Sales], ALL ( Sales ) ) )It looks right in a simple visual. Then someone selects 2026 in a year slicer, and the percentages in the matrix add up to 12% instead of 100%.
The reason is expanded tables. In DAX, a fact table filtered through a relationship includes the columns of the dimension tables it relates to. ALL ( Sales ) therefore removes filters coming from Date, Customer, Region and every other dimension related to Sales — not just from Sales itself. The denominator becomes all sales, all time, everywhere.
Fix: remove filters only from the dimension you are computing the share across:
% of Product Total =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product' ) )
)Now the year slicer still applies to the denominator, and the percentages add up to 100% within the selected year.
3. Bug 2: ALL on one column returns 100% everywhere
To get share of category, someone writes:
% of Category =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], REMOVEFILTERS ( 'Product'[Category] ) )
)…and puts it in a matrix with Subcategory on rows. Every row shows 100%.
REMOVEFILTERS ( 'Product'[Category] ) removes the filter on the Category column only. The visual's rows filter Subcategory, and that filter is untouched — so the denominator is still the current subcategory, and the ratio is 1.
Decide what the denominator should be and remove filters from every column that would otherwise restrict it. For share of all products, remove filters from the whole Product table. For share within the parent category, remove filters from the lower levels and keep the category:
% of Parent Category =
DIVIDE (
[Total Sales],
CALCULATE (
[Total Sales],
REMOVEFILTERS ( 'Product' ),
VALUES ( 'Product'[Category] )
)
)REMOVEFILTERS ( 'Product' ) clears every product filter, and VALUES ( 'Product'[Category] ) puts back only the current category.
4. Bug 3: the total ignores the user's selection
A user filters the page to five products with a slicer and expects the matrix to show each product's share of those five. REMOVEFILTERS ( 'Product' ) removes the slicer filter too, so the denominator is all products and the five shares add up to, say, 40%.
That is what ALLSELECTED is for. It removes filters coming from the visual's own rows and columns but keeps filters from outside the visual — slicers, page and report filters:
% of Visible Total =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], ALLSELECTED ( 'Product' ) )
)Use it when the business question is share of what I am looking at. Use REMOVEFILTERS when it is share of everything, regardless of selection. Both are legitimate; the bug is picking one when the user expects the other — so write the expected behaviour in the measure description.
5. A checklist for any % of total measure
- Write down the denominator in words: share of all products in the selected year, share within category, share of what is on screen.
- Remove filters only from the dimension the share is across — never from the whole fact table.
- Check every column on the visual's rows and columns: any that filter the denominator's table must be removed or deliberately kept.
- Choose
REMOVEFILTERS(everything) orALLSELECTED(what is selected) on purpose. - Wrap the division in
DIVIDEso empty denominators return BLANK instead of an error. - Test with a slicer selection and with a hierarchy drilled down — that is where all three bugs appear.
Paste your measure into the DAX Measure Doctor to flag ALL on fact tables and unsafe division automatically, or practise the patterns in the DAX practice arena.
Check your percentage measures
The DAX Measure Doctor flags ALL on fact tables, missing DIVIDE and other context mistakes in seconds.
Get the next Engineering Note
Practical DAX, semantic model and Fabric notes. 1–2 a month, unsubscribe any time.