Forum Discussion

mbd's avatar
mbd
Helper I
9 years ago
Solved

Calculating an Average on a Line Chart

Hi, 

 

I'm calculating an average on a line chart as follows:

AvgItemA = Calculate(average(vPlantItemWklyData[WklyItemA]), allselected(vPlantItemWklyData))

 

I've used this form on another average in another chart and it works great. 

I this line chart I'm getting an incorrect answer. PowerBI is returning an average of 0.95 and the answer should be 1.62.

 

What am I doing wrong?

 

Thanks

 

Here's my data

DateItemWklyItemA
9/14/2009 0:00ItemA1.945312
10/5/2009 0:00ItemA1.894224
11/2/2009 0:00ItemA1.762736
11/4/2009 0:00ItemA1.762736
11/30/2009 0:00ItemA1.779186
1/7/2010 0:00ItemA1.801572
1/8/2010 0:00ItemA0.900786
2/1/2010 0:00ItemA1.998774
3/1/2010 0:00ItemA1.95201
3/29/2010 0:00ItemA1.986208
4/5/2010 0:00ItemA0.976768
4/26/2010 0:00ItemA1.998508
5/10/2010 0:00ItemA0.995925
5/25/2010 0:00ItemA0.994673
5/26/2010 0:00ItemA0.994673
6/7/2010 0:00ItemA1.9206
6/8/2010 0:00ItemA0.9603
6/21/2010 0:00ItemA1.908812
7/6/2010 0:00ItemA1.947682
7/19/2010 0:00ItemA0.993915
8/2/2010 0:00ItemA1.945164
8/16/2010 0:00ItemA1.861134
8/30/2010 0:00ItemA1.932866
  • mbd's avatar
    mbd
    9 years ago

    Your questions led me to my solution. 

     

    I was summing data points for the week that should not have been summed. Then when I calculated the average it averaged all the data points. Once I correct this I got the correct average.

     

    Thanks!

  • Hi mbd,

     

    Great to hear the problem got resolved! Could you accept your reply above as solution to close this thread? :smileyhappy:

     

    Regards

4 Replies

  • v-ljerr-msft's avatar
    v-ljerr-msft
    Microsoft Employee

    Hi mbd,

     

    Based on my test, the result of the measure is 1.62. 

     

    What column are you showing as Axis on the Line Chart? Do you have any Slicer applied on your report? Could you share a sample pbix file which can reproduce the issue, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.:smileyhappy:

     

    Regards

    • mbd's avatar
      mbd
      Helper I

      Your questions led me to my solution. 

       

      I was summing data points for the week that should not have been summed. Then when I calculated the average it averaged all the data points. Once I correct this I got the correct average.

       

      Thanks!

      • v-ljerr-msft's avatar
        v-ljerr-msft
        Microsoft Employee

        Hi mbd,

         

        Great to hear the problem got resolved! Could you accept your reply above as solution to close this thread? :smileyhappy:

         

        Regards