Sum(TOTAL Sales) / Sum(TOTAL <Category> Sales)

The TOTAL qualifier in Power BI

Qlik's TOTAL qualifier makes an aggregation ignore the chart dimensions but keep the selections. In DAX that is ALLSELECTED. TOTAL <Field> keeps one dimension, which maps to removing only the other dimension columns.

Direct equivalent DAX

Short answer: Sum(TOTAL Sales) is CALCULATE([Sales], ALLSELECTED()). Sum(TOTAL <Category> Sales) in a chart by Category and Product is CALCULATE([Sales], ALLSELECTED(Product[Name])).

What it does in Qlik

By default an aggregation in a chart is computed per combination of dimension values. TOTAL disregards the chart dimensions, so every row gets the total for the current selection. TOTAL <Field list> disregards all dimensions except the listed ones. This is the standard way to compute shares.

Qlik example

Qlik chart expressions
Sum(Sales) / Sum(TOTAL Sales)                // share of total
Sum(Sales) / Sum(TOTAL <Category> Sales)     // share within category

Power BI equivalent

Share of total

DAX
Share of total =
DIVIDE ( [Sales], CALCULATE ( [Sales], ALLSELECTED () ) )

Share within the parent category

Remove only the inner dimension. The row's Category filter stays.

DAX
Share in category =
DIVIDE ( [Sales], CALCULATE ( [Sales], ALLSELECTED ( Product[Name] ) ) )

Visual calculation alternative

Visual calculations (on a table or matrix) work on the visual's own axes, which is closest to how Qlik thinks about a chart:

DAX (visual calculation)
Share = DIVIDE ( [Sales], COLLAPSEALL ( [Sales], ROWS ) )

Gotchas and behaviour differences

  • ALL() instead of ALLSELECTED() also ignores slicers, which is {1} TOTAL in Qlik terms, not TOTAL.
  • ALLSELECTED behaves unexpectedly when the measure is called inside an iterator. Keep share-of-total measures at the top level of a visual.
  • In DAX, visual-level filters (for example a Top N filter on the visual) are part of what ALLSELECTED restores. A share can then add up to 100% of the visible rows, not of the whole selection.

Official documentation

Related pages

Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.