Forum Discussion

rynhowl's avatar
rynhowl
Microsoft Employee
3 years ago
Solved

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...
  • VahidDM's avatar
    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
        _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!! 

    LinkedIn | Twitter | Blog | YouTube