Forum Discussion
san17680
Helper II
3 years agoAverage Sales Per customer not working
Hi All,
i have tried to get avg sales per cust, but its not working, it somehow shows total sales.
here is my formula
AVG SALES PER CUST = AVERAGEX(VALUES(Customer[Customer]),SUM(Sales_data[Sales Amount]))
i also tried,
AVG SALES PER CUST = AVERAGEX(VALUES(Customer[Customer]),CALCULATE(SUM(Sales_data[Sales Amount])))
it did not work as well.
Thanks
But total sales measure sums the values as in option 2, isn't it?
Then, it wouldn't be possible to achieve result in 1
ok thanks for your time.
10 Replies
- san17680
Helper II
Thanks for your response
when i calculate
AVG SALES PER DAY = AVERAGEX(VALUES('Calendar'[Date]),[TOTAL_SALES])I use sales measurewhy do we use average inside averagex as you suggested,i thought averagex would iterate on each customers sales and then average all of the rows in the formula [AVG SALES PER CUST = AVERAGEX(VALUES(Customer[Customer]),SUM(Sales_data[Sales Amount]))]?is this correct understanding?Thanks- mlsx4
Memorable Member
Hi san17680
You need first to calculate the average for each customer (AVG inside the calculate) and then if you want the average for the whole column, then you need to use AVERAGEX which will evaluate the expression row by row. If you sum, it will compute the SUM for each customer and later on, the AVERAGEX will compute the average over that sum.
Sorry in advance if I haven't explained it clearly