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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ikarouscb
Frequent Visitor

Calculate Cumulative demand column based on Part NO and Date (oldest to newest)

Hello Awsome comunity 

is there anyone that can help me to calculate this Power BI column based on the following information

0.- the column "**bleep** Demand" shows the real reesults that need to be obtain from the dax formula, (it appears on the image due to i manually calulated it on Excel, but needs to be calculated via DAX on power BI)

 

1.- the PKGREQ colum is the one that should be added

2.- the addition must happen on dates order from oldest to newest

3.- the **bleep** cuantity should restart everytime the part number changes, or take the latest cumulative value of the same part number from the previous date

 

it should be performed on a Colum due to the right colums calculate using the "**bleep** Demand" as base for independant calculation

Example 1 - One Part Number

ikarouscb_0-1714684872436.png

Example 2 - Two part numbers

ikarouscb_1-1714684979480.png

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @ikarouscb ,

 

1. Add an index column after sorting the date column in ascending order in the power query editor.

vkaiyuemsft_0-1714714960722.png

 


2. Create a calculated column in power bi desktop.

Column 2 =
CALCULATE(SUM('Table'[pkgreq]),FILTER(ALL('Table'),'Table'[partno] = EARLIER('Table'[partno]) && 'Table'[Index] <= EARLIER('Table'[Index ])))

vkaiyuemsft_1-1714714997216.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

ikarouscb
Frequent Visitor

Hello Clara!! thank you very much for the help this was so helpfull for my development!! i really apreciate the support!! now the file is working great!!

 

View solution in original post

2 REPLIES 2
ikarouscb
Frequent Visitor

Hello Clara!! thank you very much for the help this was so helpfull for my development!! i really apreciate the support!! now the file is working great!!

 

Anonymous
Not applicable

Hi @ikarouscb ,

 

1. Add an index column after sorting the date column in ascending order in the power query editor.

vkaiyuemsft_0-1714714960722.png

 


2. Create a calculated column in power bi desktop.

Column 2 =
CALCULATE(SUM('Table'[pkgreq]),FILTER(ALL('Table'),'Table'[partno] = EARLIER('Table'[partno]) && 'Table'[Index] <= EARLIER('Table'[Index ])))

vkaiyuemsft_1-1714714997216.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors