Share of total in DAX: ALL, ALLSELECTED and the measure that always returns 100%
The three ways a percentage-of-total measure goes wrong, why the denominator must clear the dimension and not the fact, and a pattern that survives slicers.
7 min read · updated 2026-09-21
The bug that looks like a feature
A share measure divides the current value by a total. The total is computed with CALCULATE and a filter modifier that removes the filter on the attribute you are sharing over. Three things go wrong in practice, and all three produce a number that looks like a percentage.
-- 1. Column reference used as a filter: evaluates to TRUE for non-blank rows, -- removes nothing, the share is always 100 %. Share A = DIVIDE ( [Sales], CALCULATE ( [Sales], DimCustomer[Country] ) ) -- 2. ALL on the fact column: the slicer filters the dimension, so the -- denominator stays filtered and the share is 100 % again. Share B = DIVIDE ( [Sales], CALCULATE ( [Sales], ALL ( Sales[CountryCode] ) ) ) -- 3. ALL on the whole dimension: works until the user picks two countries -- in a slicer and expects the shares to add up to 100 %. They add up to less. Share C = DIVIDE ( [Sales], CALCULATE ( [Sales], ALL ( DimCustomer ) ) )
Which filter to clear
Clear the filter on the dimension column the visual slices by, not on the fact column and not on the whole table. Use ALLSELECTED when the share must respect the slicer selection (shares of the selected countries add to 100 %), ALL when it must be the share of the entire population regardless of slicers.
Say which one you mean in the measure name. 'Share of selected countries' and 'Share of all countries' are two different numbers and finance will ask which one they are looking at.
Country share % = VAR Current = [Sales] VAR Denominator = CALCULATE ( [Sales], ALLSELECTED ( DimCustomer[Country] ) ) RETURN DIVIDE ( Current, Denominator )
Totals and hierarchies
On the total row of a matrix the current value equals the denominator, so the share is 100 %: correct, but often unwanted. If the visual also slices by region above country, ALLSELECTED on the country column keeps the region filter and the shares add to 100 % within each region. That is usually what the reader expects; if not, clear both columns explicitly.
Always use DIVIDE rather than the division operator: a country with no sales in the denominator returns BLANK instead of an error that hides the whole visual.
What the audit checks
The static audit recognises share measures by their shape (DIVIDE of a measure by the same measure under CALCULATE) and flags denominators that clear a fact column, clear nothing, or use a bare column reference. The AI review then reads the report to tell you which visual slices by which column, so the recommendation names the right dimension.