Forum Discussion
rynhowl
3 years agoMicrosoft Employee
Summarize a summarize
How do I do this SQL query in DAX? I've searched the forums; I don't know if I'm just searching the wrong terms or what, but I can't find anything that works. SELECT AVG(SumOfMaxGrades) AS C...
- 3 years ago
Hi rynhowl
Try this measure:
Class Average Grade = VAR _A = SUMMARIZE ( 'Table', 'Table'[Student], 'Table'[Assignment], "Max Grade", MAX ( 'Table'[Grade] ) ) VAR _B = SUMX ( _A, [Max Grade] ) / COUNTROWS ( VALUES ( 'Table'[Student] ) ) RETURN _BOutput:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
VahidDM
3 years agoSuper User
Hi rynhowl
Try this measure:
Class Average Grade =
VAR _A =
SUMMARIZE (
'Table',
'Table'[Student],
'Table'[Assignment],
"Max Grade", MAX ( 'Table'[Grade] )
)
VAR _B =
SUMX ( _A, [Max Grade] ) / COUNTROWS ( VALUES ( 'Table'[Student] ) )
RETURN
_B
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
rynhowl
3 years agoMicrosoft Employee
Thank you, this was a good idea 🙂