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! Learn more

Reply
Anonymous
Not applicable

DAX -Average Calculation for a category not matching up to sub-category level

I have a dataset on revenue and volume of certain SKUs, rolled-up into product categories, and then into customers. I am trying to calculate average selling price (formula:revenue by volume) for each SKU, and subsequently for each category, and eventually for each customer. 

 

The issue is that ASP at the SKU level is calculated correctly, however the numbers don't make sense at category, and customer level. For example, in 2017, it says ASP for category 1 is 0.90, when in fact, category 1 is made up of many SKU with majority of them havnig 20+ ASP.

 

Both the sample dataset and the PBI report can be accessed through here: Data  

 

Thanks in advance!

1.jpg2.jpg

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, just add a new measure as below:

Measure 3 = 
var _table=SUMMARIZE(Sheet1,Sheet1[Customer Name],Sheet1[Product Category],Sheet1[Product],Sheet1[Year],"_value",[ASP])  return
AVERAGEX(_table,[_value])

Result:

1.JPG

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, just add a new measure as below:

Measure 3 = 
var _table=SUMMARIZE(Sheet1,Sheet1[Customer Name],Sheet1[Product Category],Sheet1[Product],Sheet1[Year],"_value",[ASP])  return
AVERAGEX(_table,[_value])

Result:

1.JPG

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Greg - Thanks for the quick reply. Unfortunately, my issue is different to the solution you were referencing to. 

 

The issue is not with the incorrect 'Total' row that falls at the bottom of a table/matrix, but rather a case of an aggregation of a measure, which is then further aggregated. In my case, average selling price by each SKU, which then aggregates to average selling price by product category, and subsequently by customer.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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