Forum Discussion
measure for classifying sales
Hi
I have the following challenge. I have a table with the following fields (among others)
<reseller>, <customer>, <units_sold>, <timestamp>
I want to classify resellers based on their production and in the context of time. This means that a reseller is
Small: if the total sales is between 0-100 units
Medium: 101 to 500
Large: 501 plus
and I want to plot a graph with the number of small, medium, large resellers over time (day, month, QTR, year, overall). I suspect I would need three measures that would count the number of resellers in each bin and then graph these.
There is a catch though. the units sold, are not the sales in the specific time period but the commulative sales of the partner up until the end of the particular period. For example a parther would appear as small as he starts doing business and will transition to medium and large as he sells.
this means that if a customer sells one unit per day, 30 days per month, the first 100days he would appear as small, after than up untill 500days he will be medium and after than large.
Thus, I don't want to be only counting the sales of the specific period but his sales up until the end of the said period...
thank you in advance
Chronis
6 Replies
- AnonymousNot applicable
Hi Anonymous,
I think i may find a solution for classifying the reseller,
First of all, you can create a new calculate column to calculate the cumulative sum by each Reseller, and then another new condition column to classify the reseller.
Here is my dataset:
1. I add a Index column to name each row
2. New calculated column: Total_Sold to do a cumulative sum
Total_Sold = CALCULATE(
SUM(Seller[Unit_Sold]);
FILTER(
ALL(Seller);
'Seller'[Row ID] <= EARLIER('Seller'[Row ID])
&& Seller[Reseller] = EARLIER(Seller[Reseller])
))3. Classify the reseller
Hope this can help you ;).
Chen
- AnonymousNot applicable
Anonymous wow this is quite informative.
thank you very much for the prompt reply. I'll give it a go with my data set and let you know
If i understand this correctly, the "total sold" is a new calculated table, right?
- AnonymousNot applicable
Hi Anonymous,
You are welcome !
Yes, ""Total sold" is the new calculated column, this is the DAX Formule:
Total_Sold = CALCULATE(
SUM(Seller[Unit_Sold]);
FILTER(
ALL(Seller);
'Seller'[Row ID] <= EARLIER('Seller'[Row ID])
&& Seller[Reseller] = EARLIER(Seller[Reseller])
))Happy to be helpful :catvery-happy: