Forum Discussion

tasmia93's avatar
tasmia93
Icon for Microsoft Employee rankMicrosoft Employee
2 years ago
Solved

DAX 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...
  • tasmia93's avatar
    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