Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JMSNYC
Helper III
Helper III

Cumulative Sum in Power Query

Good evening.

 

I am having this problem, when I need to add any incremental sales adjustment for a given month, within a 3 month period.

 

 

f63e276426bf84a48d6db52953431042.png

 

I tried the group function, but it does not add the previous revised row.

 

AND THEN ... 

 

Each of these sum rows are specific to a country field. 😞

 

Could anyone help me with this issue?

 

Thank you in advance.

 

 

1 REPLY 1
AllisonKennedy
Super User
Super User

@JMSNYC  Is the historical data in the same table as the new form input? If they are in different tables, seems like you first want to do a cumulative sum, then append and group the two tables. 

 

To do the cumulative sum, you will need a column that determines order, such as an index column. You will also need to add a condition that checks if the country is the same. 

 

Here is a post to get you started on the cumulative sum side of things: https://exceloffthegrid.com/power-query-running-total/

 

If you need help with the different countries side of things, please provide some sample data with the right granularity (ie is there more than one entry per month in the same country in historical data? How to handle this?)


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.