ALLSELECTED inside an iterator
"ALLSELECTED inside an iterator" is one of the dax quality checks Auditabi runs on a Power BI semantic model. n expression(s) use ALLSELECTED inside SUMX, AVERAGEX or a similar iterator. It is a low-severity finding: hygiene and maintainability, worth fixing when you next touch the object. Compute the ALLSELECTED total once in a variable outside the iterator, then use the variable inside it.
What is detected
n expression(s) use ALLSELECTED inside SUMX, AVERAGEX or a similar iterator. ALLSELECTED depends on the shadow filter context of the visual, and inside a row context it returns a value that changes with the layout of the report rather than with the data.
Why it matters
Hygiene and maintainability. Fix when touching the object.
How to fix it
Compute the ALLSELECTED total once in a variable outside the iterator, then use the variable inside it.
Reference
SQLBI: Understanding ALLSELECTED
Does your model fail this check?
Free static audit with the exact objects, no account, nothing stored.
More DAX checks
- Arithmetic or comparison on a measure that returns text
- Measure returning text in one branch and a number in another
- Share denominator clears a fact-table column instead of the dimension
- "Previous period" window overlaps the current one
- Percentage label built without ×100
- Percentages and amounts summed together