Forum Discussion

UK_User123456's avatar
UK_User123456
Resolver I
7 years ago
Solved

Average Calculation

Hi All,

 

I have the below data, im just simply trying to do an average calulcation for each of the ID's that I have, normally I would have just put the "Amount" into the values field and used the average function, but it does not give me the average function to select, is there anothger way of doing this?

 

IDAmount
112
110
13
15
16
220
227
232
315
416
517
63
645

 

my outcome would be:

 

IDAmount
17.2
226.33333
315
416
517
624
  • Anonymous's avatar
    Anonymous
    7 years ago

    cosminc yeah. You can use the little down arrow there to change it to any other summarization type, such as average. Or of course write an explicit measure that does the same thing. Such as...

     

    Avg Amount = AVERAGE(TableName[Amount])

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    This is fairly easy in the Query Editor. Go to the Transform tab and use the Group By button. Group by your ID column and use sum of Amount as the aggregation type.

     

     

    That assumes you want a hard table with this aggregation pre-calculated. You can also do this in a report by either writing a measure that does an average of Amount, and just set that measure next to the ID column on your report page, or just drop the two columns side by side and set the aggregation on Amount to average, and ID to "do not summarize."

  • cosminc's avatar
    cosminc
    Post Partisan

    Hi

    the column Amount is number type and Modelling - Default summarization is Sum?

     

    Hope it helps,

    Cosmin

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      cosminc yeah. You can use the little down arrow there to change it to any other summarization type, such as average. Or of course write an explicit measure that does the same thing. Such as...

       

      Avg Amount = AVERAGE(TableName[Amount])

       

      • UK_User123456's avatar
        UK_User123456
        Resolver I

        Hi All,

         

        Thanks for the response, it just clicked to me after reading your responses that my amount for some reason when imported into power bi it changed the format to text when it should have been whole number which is the reason I couldnt summarise it.

         

        Thanks