Forum Discussion

MP_123's avatar
MP_123
Microsoft Employee
9 years ago

sumx question

hi,

i want to create a weighted average as below image

the most left is the numirator , and the most right is the denominator.

i want to create: 5316278/1+314443/2

the result for each row is correct, but the total is just sum of both divded by two, why is that?

this is the measure:

WeeklySumAVGPerWeek =

WeeklySumAVGPerWeek = sumx(AggregatedWeeklyNewCoverageAllExpsView,DIVIDE(AggregatedWeeklyNewCoverageAllExpsView[WeeklySumPre],DISTINCTCOUNT(AggregatedWeeklyNewCoverageAllExpsView[TargetDate])))

 

thanks!

11 Replies

      • MP_123's avatar
        MP_123
        Microsoft Employee

        this is the definition of sumx -

        Returns the sum of an expression evaluated for each row in a table.

         

        seems like it's not the sum of an expression-

        what the PBI does is sum(UsersCount)\2