Forum Discussion
ebecerra
Microsoft Employee
7 years agoGraphing weighted average by day
I'm having a problem trying to graph the weighted average of my data. I've already tried to look in the forums for similar scenarios but didn't really find anything that I could use as baseline. Let ...
- 7 years ago
There shouldn't be any need to use ALLSELECTED in your Wavg measure.
The denominator should be simply the sum of Session Count in the current filter context.
Try this:
Wavg = DIVIDE ( SUMX ( 'Table', 'Table'[Score] * 'Table'[Session Count] ), SUM ( 'Table'[Session Count] ) )This should give the correct weighted average whether filtered by Date or anything else.
Does this give the correct result?
Regards,
Owen
dax
Community Support
7 years agoHi ebecerra,
You could try to use below measure to get your result
WAvg1 = DIVIDE(
SUMX ( 'Table', 'Table'[Score] * 'Table'[Session Count] ),
CALCULATE (
SUMx ('Table', 'Table'[Session Count] )
)
)You could compare
Measure 2 = CALCULATE ( SUMX ( 'Table', 'Table'[Session Count] ) ) and Measure 3 = CALCULATE ( SUM ( 'Table'[Session Count] ), ALLSELECTED ( 'Table' ) )
Measure 3 will return total in each row, and measure 2 will calculate total based on current context
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.