Power Pivot - Average SKU per order

Evans2

Board Regular
Joined
Jun 11, 2015
Messages
56
Hi all,

Working on creating a measure that will calculate the average number of SKU's (products) per order.

I have:

Total order count =DISTINCTCOUNT([INVOICE_NO])
Total SKU Count =DISTINCTCOUNT(Products[NAME])

then I'm trying to create an average SKU per customer order

=CALCULATE(AVERAGE([SKU]),([Order Count])) or =CALCULATE(AVERAGE([SKU]),[Order Count])

But this errors out. Is this a context error or lack of brain cells error?

Any help would be appreciated.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You may need to redefine your Total SKU Count measure following the pattern here:
http://www.daxpatterns.com/distinct-count/

Then, for average number of SKUs per order, I think you want a measure like this :
Code:
= AVERAGEX ( VALUES ( [COLOR=#ff0000]TableName[/COLOR][INVOICE_NO] ), [Total SKU Count] )

Ideally include the appropriate TableName in front of [INVOICE_NO].

You need the AVERAGEX to iterate over INVOICE_NOs so that the distinct SKUs are counted independently for each invoice, then averaged.

Does this give the expected result?
 
Last edited:
Upvote 0
Hi Ozeroth,

Thanks so much for the help.

I Changed the SKU measure to count products in my sales table instead of my products table: Total SKU:=DISTINCTCOUNT(Sales[PRODUCT_NAME])

I then use AVERAGEX to iterate over INVOICE NOs in my sales table: Avg SKU:=AVERAGEX(VALUES(Sales[INVOICE_NO]),[Total SKU])

This worked for me. Thank you again. Extremely helpful!
 
Upvote 0

Forum statistics

Threads
1,224,136
Messages
6,176,562
Members
452,735
Latest member
CristianCaruceriu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top