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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Iamnvt
Continued Contributor
Continued Contributor

Running total without date,rank

hi,

 

How can I write a measure to get the running total for this below case? I know how to write for a calculated column, just wondering how it will be with a measure.

 

Thanks

 

Column1Column3ExpectedResult
A22
A35
A16
B33
B47
B512
B618
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Iamnvt

 

Here you go.

 

RunningTotal Measure = CALCULATE(
SUM( MovingSum[Column2]),
FILTER(  ALL(MovingSum) ,
SUMX( FILTER( MovingSum, EARLIER( MovingSum[Column1] ) = MovingSum[Column1] && EARLIER(MovingSum[Index]) <= MovingSum[Index] ), MovingSum[Column2] )
)
)

 

This assumes you have created an index column using query editor.

 

If this works for you please accept this as a solution and also give KUDOS.

 

Cheers

 

CheenuSing

View solution in original post

5 REPLIES 5
Melvlee
Helper I
Helper I

Hi there,

 

Have you tried the quick measures feature?

Please refer to Quick Measures

 

Regards

Anonymous
Not applicable

Hi @Iamnvt,

 

The quickmeasure as suggested @Melvlee will not work because it will reset at every row of Column1.

 

The method suggested by @Ashish_Mathur will compute but will fail in display.  The rows will not be displayed in the same order as original data table.

 

If you want the values to be displayed in the same order as your input data you will have to bring in the index column defined in the excel work sheet by @Ashish_Mathur and sort in the table display by index column.

 

If this works for you please accept @Ashish_Mathur suggestion as a solution and do give KUDOS to me as well.

 

Cheers

CheenuSing

Iamnvt
Continued Contributor
Continued Contributor

hey, I want to write a MEASURE (Calculated field), not a Calculated column.

is there any solution for that?

Anonymous
Not applicable

Hi @Iamnvt

 

Here you go.

 

RunningTotal Measure = CALCULATE(
SUM( MovingSum[Column2]),
FILTER(  ALL(MovingSum) ,
SUMX( FILTER( MovingSum, EARLIER( MovingSum[Column1] ) = MovingSum[Column1] && EARLIER(MovingSum[Index]) <= MovingSum[Index] ), MovingSum[Column2] )
)
)

 

This assumes you have created an index column using query editor.

 

If this works for you please accept this as a solution and also give KUDOS.

 

Cheers

 

CheenuSing

Ashish_Mathur
Super User
Super User

Hi,

 

I am assuming that you want to ccreate a calculated column formula.  If that be the case, you may refer to my solution here.  Go the Data Model to see the result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors