How to achieve running total with power query?

后端 未结 6 543
傲寒
傲寒 2021-01-06 05:56

I want to do a running total with power query like I did with Tableau software before. Does anyone have ideas, thanks in advance!

6条回答
  •  走了就别回头了
    2021-01-06 06:36

    Very easy.

    Step 1: Add an index

    #"Added Index" = Table.AddIndexColumn(#"**Prior Step**", "Index", 0, 1)
    

    Step 2: Add a running total

    #"Added Running Total" = Table.AddColumn(#"Added Index", "Running Total, each List.Sum(List.FirstN(#"Added Index"[**Column to Add Values From**],[Index]+1)))
    

提交回复
热议问题