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! Learn more

Reply
DaxBoi
New Member

Cumulative Running Total

Hi All,

 

I have included a sample of my dataset below, I'm struggling to get the code for the third column to work and any help would be much appreciated.

 

IDTotal OccurencesCumulative Occurences
141
142
231
143
144
232
233
311
411
2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@DaxBoi - You will need something like an Index column to define "previous". Then it should be super easy. Just 

COUNTROWS(FILTER('Table',[ID]=EARLIER([ID]) && [Index]<=EARLIER([Index])))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

amitchandak
Super User
Super User

@DaxBoi , you need to add an index column and then you can create Cumulative

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

Create a new column

countx(filter('Table',[ID]=earlier([ID]) && [Index]<=earlier([Index])),[ID] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
fhill
Resident Rockstar
Resident Rockstar

P.S.

 

Not exaclty sure the purpose of 'ID' in your table, but you can perform a 'Running Total' in this mannor as well without an Index column, BUT you have to SORT your ID low to high.

 

fhill_0-1598465627779.png

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




amitchandak
Super User
Super User

@DaxBoi , you need to add an index column and then you can create Cumulative

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

Create a new column

countx(filter('Table',[ID]=earlier([ID]) && [Index]<=earlier([Index])),[ID] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@DaxBoi - You will need something like an Index column to define "previous". Then it should be super easy. Just 

COUNTROWS(FILTER('Table',[ID]=EARLIER([ID]) && [Index]<=EARLIER([Index])))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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