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

Get Fabric certified for FREE! Don't miss your chance! Learn more

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
Community Champion
Community Champion

@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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.