Forum Discussion
smpa01
2 years agoCommunity Champion
DAX forLoop
AlexisOlson is it possible to replicate a forLoop in DAX. I need a forLoop that works in filter context. I am not able to find anything that can do the following in DAX.
let
src=Table...
- 2 years ago
Custom DAX = VAR i = [index] VAR b = ADDCOLUMNS ( FILTER ( Query1, [index] >= i ), "g", VAR i2 = [index] RETURN SUMX ( FILTER ( Query1, [index] >= i && [index] <= i2 ), [Value] ) ) RETURN CONCATENATEX ( FILTER ( b, [g] <= 100 ), [row], "-" )
lbendlin
2 years agoSuper User
All iterator functions are For Loops in DAX. SUMX, MAXX, PRODUCTX etc. One could argue that SUMMARIZE, SUMMARIZECOLUMNS and GENERATE are For Loops too.