Forum Discussion
tylerr2142
5 years agoNew Member
Calculate Average for Common Columns in Matrix
I would like to calculate the average of the baseline assessment for just the common standards. In this case, it should be the average of 7.1, 7.2 and 7.3. I would also like to calculate (nonbaseline...
tylerr2142
5 years agoNew Member
amitchandak Anonymous
The data structure looks like the below:
| Username | AttemptDate | Exam | Section | Score |
| Sally | 1/1/2020 | Baseline | 1.1 | 50% |
| Sally | 1/1/2020 | Baseline | 1.2 | 25% |
| Sally | 1/1/2020 | Baseline | 1.3 | 100% |
| Sally | 1/1/2020 | English 101 | 1.1 | 75% |
| Sally | 1/1/2020 | English 101 | 1.2 | 80% |
| Sally | 1/1/2020 | English 101 | 1.4 | 90% |
| Sally | 1/1/2020 | English 101 | 1.7 | 95% |
I want to be able to calculate the improvement from Baseline exam to other Non-Baseline exams with identical sections. (I.E: a score of 50% for baseline section 1.1 to the 75% for English 101 section 1.1.
Thanks for the help!
Anonymous
5 years agoNot applicable
Hi tylerr2142,
Did you mean you want to calculate the average 'Score' across multiple exams based on the most general 'Section' which existed all exams, right?
If that is the case, you can try to use the following measure expression to replace the scope field to use in matrix and confirm if it works on your side:
Measure =
VAR currSelection =
MAX ( 'Table'[Section] )
VAR _list =
CALCULATETABLE (
VALUES ( 'Table'[Section] ),
FILTER (
SUMMARIZE (
ALLSELECTED ( 'Table' ),
[Username],
[AttemptDate],
[Section],
"cExam", COUNTA('Table'[Exam])
),
[cExam] >= 2
)
)
RETURN
IF (
currSelection IN _list,
CALCULATE (
AVERAGE ( 'Table'[Score] ),
ALLSELECTED ( 'Table' ),
VALUES ( 'Table'[Username] ),
VALUES ( 'Table'[AttemptDate] ),
VALUES ( 'Table'[Section] )
)
)
Regards,
Xiaoxin Sheng