Distinct Count in Power Pivot for Data analyst book

Abhay Gadiya

New Member
Joined
Jul 1, 2013
Messages
24
I am currently reading Power Pivot for Data Analyst book by Mr. Excel. In Chapter 10 he explains about "Countrows(Distinct(Sales[Customer]))" function. Later using this function average sales per customer is calculated using measure "=Sum(Sales[Revenue])/Sales[DistinctCustomers]".

I noted that this average sales per customer (Avg.) measure gave correct values for all combination in pivot except when I put the customer names in "Row" area. Then it gave "Total Sales" for that customer.

Is there a different measure formula we should use which will show both average sales per customer and also average sales customer wise.

You can refer to file "10-Distinct.xlsx" available at Que publishing site
PowerPivot for the Data Analyst: Microsoft Excel 2010 | Que
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Perhaps:

=if(Sales[DistinctCustomers]=1,average(Sales[Revenue]),Sum(Sales[Revenue])/Sales[DistinctCustomers])
 
Upvote 0
So... Total Sales / #Customers is the SalesPerCustomer. When there is only 1 customer, that is TotalSales/1 which is TotalSales. It sounds like it all works as designed.

But you are saying... if there is only 1 customer you want... something else? What are you looking for? " also average sales customer wise." means what to you? Per day? per transaction? Per Item?
 
Upvote 0
So... Total Sales / #Customers is the SalesPerCustomer. When there is only 1 customer, that is TotalSales/1 which is TotalSales. It sounds like it all works as designed.

But you are saying... if there is only 1 customer you want... something else? What are you looking for? " also average sales customer wise." means what to you? Per day? per transaction? Per Item?

As RoryA gave the formula it works like this:

1. If there is a customer A - it will calculate average sales for that customer only.
2. If we have one more level - "Region", etc. grouping these customers it will give average considering distinct customer in that region.

I hope this clarifies. Or try putting customer in Pivot table created in above mentioned file. And then using formual given by RoryA
 
Upvote 0
I should point out that if you only have one customer in a particular level (e.g. region) you will also get the average sales for that customer, rather than the average total sales per customer. I think you'd be better off with different measures, and perhaps a clearer name for the existing measure. ;)
 
Upvote 0

Forum statistics

Threads
1,224,041
Messages
6,176,026
Members
452,697
Latest member
CuriousSpreadsheet

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