Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
zaforir2002
Helper I
Helper I

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
BI Analyst and Developer @ Queen Mary University of London, UK.
1 ACCEPTED SOLUTION
Datatouille
Solution Sage
Solution Sage

Hi @zaforir2002

 

I think you have a confusion between a calculated column and a measure.

 

If you create the DAX measure:

AvgQty = Average(YourTable[Qty] ) and bring in this measure in a pivot table, you'll get the correct result thanks to filter context.

View solution in original post

5 REPLIES 5
Datatouille
Solution Sage
Solution Sage

Hi @zaforir2002

 

I think you have a confusion between a calculated column and a measure.

 

If you create the DAX measure:

AvgQty = Average(YourTable[Qty] ) and bring in this measure in a pivot table, you'll get the correct result thanks to filter context.

Thanks, @Datatouille,

 

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

BI Analyst and Developer @ Queen Mary University of London, UK.

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.

All is from same table @Datatouille

BI Analyst and Developer @ Queen Mary University of London, UK.

Will you please share the file ? because it should work !

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors