Forum Discussion
Anonymous
9 years agoNot applicable
Sum and count customers in different value intervals
Hi, I've got a datasets with alot of rows for different customer numbers and sales value. I want to sum the sales value on each customer and then show the number of customers and the total sales ...
- 9 years ago
If you create a parameter table with the ranges you want like this:
then with Range Table desciption on rows, use these measures:Number of Customers = COUNTROWS ( FILTER ( ADDCOLUMNS ( VALUES ( CustomerID[ID] ), "Total Sales", CALCULATE ( SUM ( Sales[Sales] ) ) ), [Total Sales] >= MIN ( RangeTable[Min] ) && [Total Sales] < MAX ( RangeTable[Max] ) ) )Total Sales for Group = CALCULATE ( SUM ( Sales[Sales] ), FILTER ( ADDCOLUMNS ( VALUES ( CustomerID[ID] ), "Total Sales", CALCULATE ( SUM ( Sales[Sales] ) ) ), [Total Sales] >= MIN ( RangeTable[Min] ) && [Total Sales] < MAX ( RangeTable[Max] ) ) )I freehanded these and didn't test them, but they should be close.
Anonymous
9 years agoNot applicable
My apologies, I have yet to try the solution mattbrice suggested, but I'll return with a response as soon as I've tried it. Sorry for lateness of my reply.
My My
GershwinMunich
8 years agoRegular Visitor
I have the same issue with mutiple rows for the same customer.
Can you post the solution please?
- Anonymous8 years agoNot applicable
GershwinMunich the solution is stated by mattbrice :)
It's been a while since I worked on this now, but let me know if you can't get it to work.