Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Running total problems

Hi, 

Having some issue with running total. Can anyone suggest solution for this?

I have tried something like this, but I get the same result as in totals[total_count] column:

running sum = CALCULATE(totals[total_count], FILTER(stages, stages[created_at] <= MAX(stages[created_at])))
Also in report I dont use any date fields.
 

 

Thanks

  • Anonymous , The data you have show stage is sortable, you can use

     

    running sum = CALCULATE(totals[total_count], FILTER(stages, stages[stage] <= MAX(stages[stage])))

     

    Or Create a stage no column

     

    stages no = right([Stage], len([Stage]) -5)

     

    and then try

    running sum = CALCULATE(totals[total_count], FILTER(stages, stages[stage no] <= MAX(stages[stage no])))

3 Replies

  • Anonymous , The data you have show stage is sortable, you can use

     

    running sum = CALCULATE(totals[total_count], FILTER(stages, stages[stage] <= MAX(stages[stage])))

     

    Or Create a stage no column

     

    stages no = right([Stage], len([Stage]) -5)

     

    and then try

    running sum = CALCULATE(totals[total_count], FILTER(stages, stages[stage no] <= MAX(stages[stage no])))

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak Thank you. Solution with stage no (index) works!

  • amitchandak I think your measure needs a fix, need ALL

     

    running sum = CALCULATE(totals[total_count], FILTER(ALL(stages), stages[stage] <= MAX(stages[stage])))

     

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.