Forum Discussion
DaxBoi
6 years agoNew 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. ID Total Occurences Cumulative O...
- 6 years ago
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]))) - 6 years ago
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] )
fhill
6 years agoResident 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.