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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors