Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi all,
I'm struggling with creating a cumulative sum in Power BI desktop. The cumulative sum would be used to figure out a buying schedule for one of our internal buyers here. So the fields within the table are:
Date / Purchase Order / Item Number / Quantity
So with each change in Purchase Order/Item Number, I need to calculate the cumulative sum of the Quantity field.
How can I do this? I've tried the measure below, but this isn't working - nothing I've found online is working for this. PRODPURCH is the name of the table I'm using. Thanks in advance!
Hi @Anonymous,
Based on my test, you could refer to below formula:
Measure = CALCULATE(SUM(PRODPURCH[Quantity]),FILTER(ALL(PRODPURCH),'PRODPURCH'[Item number]<=MAX('PRODPURCH'[Item number])))
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi Daniel,
Thank you for the response, but unfortunately this did not work, please see the attached image.
At each change in quantity, I'd expect the 'Measure' measure to change along with it, but it does not. Can you please advise?
Thanks, Gary
At each change in quantity, I'd expect the 'Measure' measure to change along with it
What could you mean it? Could you please offer me your sample data to have a test?
Regards,
Daniel He
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 29 | |
| 23 | |
| 18 | |
| 18 | |
| 15 |
| User | Count |
|---|---|
| 51 | |
| 44 | |
| 43 | |
| 39 | |
| 32 |