cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Create measure/Column with incremental sum

Hello ,

 

I've senerio like below.


PART   PRIORITY        ORD_DATE             BO_QTY     
P1             28        5/4/2020 0:00                 30                  
P1             29        4/17/2020 0:00              10                   
P1             29        4/17/2020 0:00              20                  
P1             29        5/12/2020 0:00              70                  
P1             29       5/12/2020 0:00              110                                                                                                                                        Output measure should be like below , Which sould be having the cumulative sum of QTY


DATE,PRIORITY and PART all are duplicated, So we can not consider any key for addition.

 

PART   PRIORITY        ORD_DATE             BO_QTY     Output Measure/Column
P1             28        5/4/2020 0:00                 30                   0
P1             29        4/17/2020 0:00              10                   30
P1             29        4/17/2020 0:00              20                   40
P1             29        5/12/2020 0:00              70                   60
P1             29       5/12/2020 0:00              110                 130   


Kindly let me know the how the "Output Measure/Column" has to be calculated on the baseic of the QTY Cumulative sum

 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Create measure/Column with incremental sum

Hi @jkalbande ,

 

We can create an index column and a calculate column to meet your requirement.

 

1. In Power Query Editor, we can add an index column using index column function.

 

Create 1.jpg

 

2. Then we can create a calculate column to get the result.

 

Output = 
var x = CALCULATE(SUM('Table'[BO_QTY]),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])))
return 
IF(ISBLANK(x),0,x)

 

Create 2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.       

 

Best regards,

 

Community Support Team _ zhenbw

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

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Create measure/Column with incremental sum

Hi @jkalbande ,

 

We can create an index column and a calculate column to meet your requirement.

 

1. In Power Query Editor, we can add an index column using index column function.

 

Create 1.jpg

 

2. Then we can create a calculate column to get the result.

 

Output = 
var x = CALCULATE(SUM('Table'[BO_QTY]),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])))
return 
IF(ISBLANK(x),0,x)

 

Create 2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.       

 

Best regards,

 

Community Support Team _ zhenbw

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

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Kudoed Authors