Forum Discussion
Cumulative Sum in Power Query
- 1 year ago
It looks like that the data is not accumulating by date. Not sure if this is what you want.
If you want to accumulate by date, you can try this
= Table.AddColumn(#"Added Index", "Custom", each List.Sum( Table.SelectRows(#"Added Index",(x)=>x[End of Month]<=[End of Month] and x[Attribute]=[Attribute] )[Value]))
if just need to accumulate by the row order, you need to create a index column , then try this
= Table.AddColumn(#"Added Custom", "Custom.1", each List.Sum( Table.SelectRows(#"Added Custom",(x)=>x[Index]<=[Index] and x[Attribute]=[Attribute] )[Value]))
pls see the attachment below
It looks like that the data is not accumulating by date. Not sure if this is what you want.
If you want to accumulate by date, you can try this
= Table.AddColumn(#"Added Index", "Custom", each List.Sum( Table.SelectRows(#"Added Index",(x)=>x[End of Month]<=[End of Month] and x[Attribute]=[Attribute] )[Value]))
if just need to accumulate by the row order, you need to create a index column , then try this
= Table.AddColumn(#"Added Custom", "Custom.1", each List.Sum( Table.SelectRows(#"Added Custom",(x)=>x[Index]<=[Index] and x[Attribute]=[Attribute] )[Value]))
pls see the attachment below