Reputation: 63
I'm having issues creating a measure which calculates the total average.
I have a total teams column (team a, team b, team c) and a goals scored column ( 1, 3, 2)...
I created a measure which computes the total goals scored (by date) of the selected team (selected via a filter), and I need to compare that against the total average goals scored (by date).
Measure for total goals
= CALCULATE([TotalGoalScored],ALLSELECTED(Teams[Teams]))
and the subsequent
AverageGoals Scored = AVERAGEX('Teams',[TotalGoalScored])
However, when I drag both of these values to a viz, and select a "team" both values are the same, (i.e. it is computing the average goals scored for only the selected team which = total goals scored). When I select "All" teams, the average is being computed correctly. What alternate formula can I use to computer average?
Upvotes: 0
Views: 130
Reputation: 577
So the problem is in the "AverageGoals Scored" measure, which shouldn't be affected by team filter? If so, how about like this:
AverageGoals Scored = CALCULACE(AVERAGEX('Teams',[TotalGoalScored]), ALL(Teams[Teams]))
Upvotes: 1