Forum Discussion
tasmia93
Microsoft Employee
2 years agoDAX Running Total/Cumulative Sum for Dimension
Hi, I am trying to get the cumulative total of products on this combo chart. I need the line to display the total running sum of the products starting with the largest sales. I tried using the D...
- 2 years ago
Thank you all for responses. I was able to get it working with the following DAX
Running Total Sale2 = VAR thissubcat = MIN ( 'Product'[Product] ) VAR summary = ADDCOLUMNS ( ALLSELECTED ( Product[Product] ), "cTS", [Total Sales] ) VAR thisTS = SUMX ( FILTER ( summary, Product[Product] = thissubcat ), [cTS] ) VAR result = SUMX ( FILTER ( summary, [cTS] >= thisTS ), [cTS] ) RETURN result
tasmia93
Microsoft Employee
2 years agoThank you all for responses. I was able to get it working with the following DAX
Running Total Sale2 =
VAR thissubcat =
MIN ( 'Product'[Product] )
VAR summary =
ADDCOLUMNS ( ALLSELECTED ( Product[Product] ), "cTS", [Total Sales] )
VAR thisTS =
SUMX ( FILTER ( summary, Product[Product] = thissubcat ), [cTS] )
VAR result =
SUMX ( FILTER ( summary, [cTS] >= thisTS ), [cTS] )
RETURN
result