In DAX, generalize the aggregation iterator functions (SUMX, MINX, etc.)
There are many aggregation iterator functions in DAX (SUMX, MINX, etc.). Their concept is the same: evaluate an expression for each row of a table and aggregate the results.
Instead of blowing up the function list with functions like these, there should either be a generic aggregation iterator function that accepts the aggregation function as an argument, or a generic iterator function that covers the iteration step but not the aggregation step (i.e. it returns a list of values to be fed to the "normal" aggregation functions).
The functions would look like this:
AGGREGATE(AggregationFunction, Table, Expression)
X(Table, Expression)
So instead of this:
SUMX(Table, Expression)
MINX(Table, Expression)
We would have this:
AGGREGATE(SUM, Table, Expression)
AGGREGATE(MIN, Table, Expression)
SUM(X(Table, Expression))
MIN(X(Table, Expression))
Once these functions are introduced, then SUMX, MINX, etc. can be deprecated.
The AGGREGATE function would also allow the aggregation type to be easily toggled/selected (using slicers and SWITCH) without repeating the Expression argument for each desired aggregation type and without using calculation items or calculation groups (which are still years away from being included in Power Pivot, if ever).
1 comment

Kenneth Barber commented