Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi! I need to identify the most sold products which represent 80% of my sales. For instance:
PRODUCT SALES CUMULATIVE SALES
A 50 50
B 20 70
C 10 80
D 8 88
E 7 95
F 5 100
Therefore, products A, B and C represents 80% of my sales.
I am able to get cumulative sales with a date dimension, but for this exercise, date is not taken into account.
Regards.
Solved! Go to Solution.
@Anonymous
Cumulative is based on the sort order , You can sort on sales
Cumm1 = CALCULATE(sum('product'[SALES]),FILTER(all('product'),'product'[SALES]>=MAX('product'[SALES])))
Better you create a dense rank and use that. New column
rank = ranks(all(Product),Product[sales],,asc,dense)
Use rank in last formula
@Anonymous ,
Can you try like
Cumm Sales = CALCULATE(SUM(Table[Sales]),filter(Table,Table[PRODUCT] <=maxx(Table,Table[PRODUCT])))
Cumm Sales = CALCULATE(SUM(Table[Sales]),filter(Table,Table[PRODUCT] <=max(Table[PRODUCT])))
You can also use the quick measure to create running total
Thanks for your answer but none of your measures cumulate sales. All of them only show up Sales without cumulation
Try with all. Have you tried quick measure
Cumm Sales = CALCULATE(SUM(Table[Sales]),filter(all(Table),Table[PRODUCT] <=maxx(Table,Table[PRODUCT])))
Cumm Sales = CALCULATE(SUM(Table[Sales]),filter(all(Table),Table[PRODUCT] <=max(Table[PRODUCT])))
https://docs.microsoft.com/en-us/power-bi/desktop-quick-measures
Sorry but none works:
@Anonymous , I think the last column is working, sort on product and check . Also you can move product in separate Tale and join on the product and try
Cumm Sales max = CALCULATE(SUM(SALES[SALES]);filter(All(Product;Product[PRODUCT]<=max(Product[PRODUCT])))
@amitchandak Thanks for your answer but I need to identify the most sold products, so I need to start cumulating from the most sold to the least sold product.
Creating a new table for Product gives me the same result.
@amitchandak I really appreciate your help but your measure works because A is the most sold product and F is the least sold product.
If you change the product names to other which do not meet the alphabet order, the formula does not work. For instance:
May you please try with these product names?
Thanks in advance
@Anonymous
Cumulative is based on the sort order , You can sort on sales
Cumm1 = CALCULATE(sum('product'[SALES]),FILTER(all('product'),'product'[SALES]>=MAX('product'[SALES])))
Better you create a dense rank and use that. New column
rank = ranks(all(Product),Product[sales],,asc,dense)
Use rank in last formula
@amitchandak This is the measure I was looking for!
Cumm1 = CALCULATE(sum('product'[SALES]),FILTER(all('product'),'product'[SALES]>=MAX('product'[SALES])))
Thanks a million!
This is a standard pattern. You can read about it here https://www.daxpatterns.com/abc-classification-dynamic/
Sorry but this example does not fit as my exercise has only one table with these two columns. I just need to set up cumulative sales
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |