Forum Discussion
Anonymous
4 years agoNot applicable
Grouping column
Hi! I need to create a formula, when I will use an existing table but with grouping, how can I do it?
- 4 years ago
Anonymous
Please try this
Total Scores = SUMX ( DISTINCT ( SELECTCOLUMNS ( CALCULATETABLE ( Table, ALLEXCEPT ( Table, Table[question] ) ), "@question", [question], "@score", [score] ) ), [@score] )
Anonymous
4 years agoNot applicable
It's very good solution, but, what if instead of sum, I need average, when I just put averagex, it works wrongly
tamerj1
Community Champion
4 years agoAnonymous
Yes exactly
- Anonymous4 years agoNot applicable
but it doesn't work, when I just put averagex
- tamerj14 years ago
Community Champion
Can you explain further with example? Also please confirm you are creating a calculated column not a measure
- Anonymous4 years agoNot applicable
I'm creating a measure, sorry that I haven't mentioned. For sum it worked, for average not
- tamerj14 years ago
Community Champion
Anonymous
I don't know how your visual look like but you may tryAverage Scores = AVERAGEX ( DISTINCT ( SELECTCOLUMNS ( CALCULATETABLE ( ALL ( Table ), ALLEXCEPT ( Table, Table[question] ) ), "@question", [question], "@score", [score] ) ), [@score] )- Anonymous4 years agoNot applicable
ALL() takes a column, not a table