Forum Discussion

DaxBoi's avatar
DaxBoi
New Member
6 years ago
Solved

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

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    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])))
  • fhill's avatar
    fhill
    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.