Forum Discussion

zaforir2002's avatar
zaforir2002
Helper I
9 years ago
Solved

Distinct Average

Hi,

 

I am using Excel PowerPivot from the tabular data model and need to do average on distinct records, although I have gone trough with many suggestions are available online, but not getting the correct output. 

 

Sample table

prodqty
Apple10
Apple15
Apple10
Organe5
Organe12
Organe12
Organe12
Banana8
Banana

8

 

Result I am getting

 

prodmy_avg_qty_return
Apple10.22222
Orange10.22222
Banana10.22222

 

Result I am expecting

 

prodavg_qty_expected 
Apple11.66667
Orange10.25
Banana8

5 Replies

    • zaforir2002's avatar
      zaforir2002
      Helper I

      Thanks, Datatouille,

       

      I have used it in a measure, not in the calculated column, but the results are same for each prod :(.

      • Datatouille's avatar
        Datatouille
        Solution Sage

        Do you have everything in the same table or do you bring in products from another table ?

        In that case, you need to create a (1 to Many) Relationship between Products and your Quantity Table.