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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jacques_N
Frequent Visitor

running sum of a measure

Hello to all,

 

In order to affect a class to a product I need to make a running total of a sorted table:

table.PNG

Whath I have in power bi are the colums in green (of course unsorted I did it in excel), an what I would like to get is the runing sum in red colum, and that for one key. As soon as the key change power BI has to restart the process.

 

Thanks for your help.

Regards

Jacques

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Jacques_N

Assume [weight] is a column

create a measure as below

running sum = CALCULATE(SUM(Sheet1[column]),FILTER(ALLEXCEPT(Sheet1,Sheet1[key]),[plant]>=MAX([plant])))

1.png

 

Assume [weight] is a measure

create a measure as below

running sum 2 = SUMX(FILTER(ALLEXCEPT(Sheet1,Sheet1[key]),[plant]>=MAX([plant])),[Measure])

2.png

 

Best Regards

Maggie

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Jacques_N

Assume [weight] is a column

create a measure as below

running sum = CALCULATE(SUM(Sheet1[column]),FILTER(ALLEXCEPT(Sheet1,Sheet1[key]),[plant]>=MAX([plant])))

1.png

 

Assume [weight] is a measure

create a measure as below

running sum 2 = SUMX(FILTER(ALLEXCEPT(Sheet1,Sheet1[key]),[plant]>=MAX([plant])),[Measure])

2.png

 

Best Regards

Maggie

Hi Maggie,

 

Thanks a lot, basically taht working very wellMan Happy, with a limited extraction of my database. But my whole dataset is nealy 1.5 M rows, and then I get "Not enough memory"Man Frustrated.

I will try to separate this calculation in a separate powerBI .

 

Thanks a lot,

 

Jacques

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.