Forum Discussion

urpalani's avatar
urpalani
Helper II
8 years ago
Solved

Calculate Avg

Hi Experts,

 

I want to calculate the Avg that is based on WT/TE ,i am not getting the sum of Avg ,

When i am doing sum i am getting 29.9 + 33.8 and when i am doing Avg it is (29.9 + 33.8) / 2 

 

But my expectation is 724.5/22 ( WT/TE) = 32.93

 

WT          TE    Avg

 149.3        5     29.9

 575.2       17    33.8

----------------------

724.5        22    32.93 (WT/TE)

 

 

Anybody have any idea,

 

Thanks,

  • Hi urpalani,

     

    Create a measure to calculate average value:

    Avg measure = SUM('Source Table'[WT])/SUM('Source Table'[TE]) 

    Then, your table visual looks like:

     

    Best regards,
    Yuliana Gu

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Is your Avg WT/TEU data coming from a measure?  It looks to me like your AVG WT/TEU is either raw data, or a calculated column.  If that was the case you won't get the correct answer.  If you can create a measure instead, you should get the bottom row context answer you expect.

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

    Hi urpalani,

     

    Create a measure to calculate average value:

    Avg measure = SUM('Source Table'[WT])/SUM('Source Table'[TE]) 

    Then, your table visual looks like:

     

    Best regards,
    Yuliana Gu