Forum Discussion
Cumulative sum by column no date
Hi, i have a little problem unsolved with a dax cumulative.
i have this table
| Category | Value |
| A | 1 |
| A | 1 |
| B | 1 |
| C | 1 |
| C | 1 |
| D | 1 |
I need to create a cumulative sum by category
So the result is this:
Category SumValues Cumulative
A 2 2
C 2 4
B 1 5
D 1 6
Total 6
How can i calculate the cumulative?
Thanks for help
4 Replies
- v-qiuyu-msft
Community Support
Hi Vvelarde,
In your scenario, why do you want to get the result based on the sorting A-> C-> B-> D. If we Group By based on Category in Query Editor, we can't sort by SumValues firstly then by Category. If we based on the normal category sorting, we can add a index column to calculate the running total easily.
Best Regards,
Qiuyun Yu
- Vvelarde
Community Champion
hi v-qiuyu-msft
I need to show order the category (A,B,C,D) by Sum of values. To Show Correctly a Cumulative Sum..Starting from Highest to Lowest.
My next step is show a measure in %.
A 2 (2/6)
C 2 (4/6)
B 1 (5/6)
D 1 (6/6)
Total 6
This is the reason of i don't show you in normal sorting
- Vvelarde
Community Champion
I had these measure that works when the sum of values is different by each category.
ValuesAcumulado = VAR valor=Calculate(Sum(Table1[Values]) RETURN SUMX(FILTER(All('Category');[SumaValues]>=valor);[SumaValues])Where Category is a single table column with A,B,C,D and SumaValues = Calculate(Sum(Table1[Values]))
The problem is when have same sum values for 2 or more categories. The Sum takes all the categories with same values.