Forum Discussion
I'm try to generating Average Values based by location code and graph the results
- 2 years ago
After some tinkering, I figured out what was wrong: I was getting a pure sum of all values without an average. I needed to divide the sum by the count of each time the location appeared and that got what I had calculated previously using Excel
Here is my final code:
= AVERAGEX(VALUES('Table'[Location#]),CALCULATE(SUM('Data'[Value 1])/COUNT('Table'[Location#])))
Hmm, your method is fantastic for getting the values as they should be, but I am seeing amounts on the Y axis that are way higher than any individual value for that code. Am I accidentally getting the sum instead of the average?
After some tinkering, I figured out what was wrong: I was getting a pure sum of all values without an average. I needed to divide the sum by the count of each time the location appeared and that got what I had calculated previously using Excel
Here is my final code:
= AVERAGEX(VALUES('Table'[Location#]),CALCULATE(SUM('Data'[Value 1])/COUNT('Table'[Location#])))