Forum Discussion

mic_rysel's avatar
mic_rysel
Frequent Visitor
7 years ago
Solved

How to Sum Aggregate values

Hi please help me,
i need to sum average's values:

Column "Average of Puma Points" is averages automatically:

And i need to do column:

Year_month, SUM(AVG(Average of puma points))

but it doesnt work.

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    For this you need a proper measure defined in DAX. Such a calculation is not possible via aggregations in GUI.

     

    Here's something that should work for this particular scenario:

     

    [Puma Points Average-Sum] :=
    var __result =
    	SUMX(
    		ADDCOLUMNS(
    			SUMMARIZE(
    				T,
    				T[Year_Month],
    				T[TaskCode]
    			),
    			"avg", CALCULATE( AVERAGEX( T[Puma_points] ) )
    		),
    		[avg]
    	)
    return
    	__result

     

    Best

    Darek

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    For this you need a proper measure defined in DAX. Such a calculation is not possible via aggregations in GUI.

     

    Here's something that should work for this particular scenario:

     

    [Puma Points Average-Sum] :=
    var __result =
    	SUMX(
    		ADDCOLUMNS(
    			SUMMARIZE(
    				T,
    				T[Year_Month],
    				T[TaskCode]
    			),
    			"avg", CALCULATE( AVERAGEX( T[Puma_points] ) )
    		),
    		[avg]
    	)
    return
    	__result

     

    Best

    Darek