Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Cumulative sum based on text

Here is my table and I have the first three columns and I am trying to calculate the 3rd column which is cumulative sum though i have dates in the bigger table i just want this small table irrespecti...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  Anonymous,

    Here are two ways to provide you:

     

    一.

    1.Power Query generate index column.

    2.Create a measure.

    Measure = CALCULATE(SUM('Table'[total]),FILTER(ALLSELECTED('Table'),'Table'[Index]<=MAX('Table'[Index])))

    3.Result

    二.

    1.Create a calculated column.

    Column = CALCULATE(SUM('Table'[total]),FILTER(ALLSELECTED('Table'),'Table'[type]<=EARLIER('Table'[type])))

    2.Result.

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.