Hello lovely people of SO,
I have a dataset that looks like so:
| ID SALE | PRODUCT | REGION |
|---|---|---|
| SE_056 | AAA | NORTH |
| XT-558 | XXX | NORTH |
| 8547Y | CCC | NORTH |
| TY856 | XXX | NORTH |
| D-895 | BBB | SOUTH |
| ER5H | CCC | SOUTH |
| 5F6F-GD | CCC | SOUTH |
| 65-FFD | TTT | SOUTH |
| 56-YU | XXX | SOUTH |
I would like to create a table that will show me the subtotal (COUNT) for each product as well as their indivudal percentage and cumulative percentage like so:
| PRODUCT | subtotal | Percentage | Cum Percentage |
|---|---|---|---|
| CCC | 3 | 0,33333333 | 0,333333333 |
| XXX | 3 | 0,33333333 | 0,666666667 |
| AAA | 1 | 0,11111111 | 0,777777778 |
| BBB | 1 | 0,11111111 | 0,888888889 |
| TTT | 1 | 0,11111111 | 1 |
Please notice that I want this table to be sort by highest subtotal to lowest subtotal and that in that matter the the cumulative percentage be as well calculated, PBI is not easy and is really coming for my mental health and I cannot find a way to get my table to be sort by highest subtotal and have the cum % calculated in that same order so if you can help me out PLEASE KNOW that i will be forever thankful
if you guys can help me out I will be so thankful I will be very attentive to your responses.


