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] )
tamerj1
4 years agoCommunity Champion
Anonymous
By group you mean same question same score? How many groups there are for each question? Are trying to sum the distinct values of scores of the question groups?
Anonymous
4 years agoNot applicable
Yes, I don't need to sum 3 times 0.21, it will be 0.63, but I need only 0.21. This score is question score, not persons, but it is shown per person, that's the problem
- tamerj14 years agoCommunity Champion
Anonymous
Please try this
Total Scores = SUMX ( DISTINCT ( SELECTCOLUMNS ( CALCULATETABLE ( Table, ALLEXCEPT ( Table, Table[question] ) ), "@question", [question], "@score", [score] ) ), [@score] )- Anonymous4 years agoNot applicable
It works for now, I need to do it couple times for some cases, but thanks a lot!!!
- Anonymous4 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
- tamerj14 years agoCommunity Champion
Anonymous
Yes exactly