Forum Discussion
Calculating the average in the graphs
In this example the accumulated per month is calculated and the line values are the average per month of Euros/Litres, but this average is different in one graph and in the other. For example in November the average is 23.52 but in the left graph it appears 22.70. Why does the left graph calculate the average wrong? How can I make the left graph so that the correct average appears, which is 23.52?
attached dropbox pbix
https://www.dropbox.com/s/b3rr05wpgr2ldy6/ejemplo.pbix?dl=0
pakovic , A per me
22.70 coming from divide(sum(Table[Euros]), sum(Table[Litres]))
the other one is
averageX(Values(table[Product]), calculate(divide(sum(Table[Euros]), sum(Table[Litres])) ))
// Avg of rows
3 Replies
- amitchandak
Super User
pakovic , That is a simple average,
In the latest version, You have fx option under the Constant line( Y axis constant line) , Use that and give this measure, you should get correct value
- pakovic
Helper I
But, is correct 22,70 or 23,52 ? I think the correct is 23,52
- amitchandak
Super User
pakovic , A per me
22.70 coming from divide(sum(Table[Euros]), sum(Table[Litres]))
the other one is
averageX(Values(table[Product]), calculate(divide(sum(Table[Euros]), sum(Table[Litres])) ))
// Avg of rows