Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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 Occurences |
| 1 | 4 | 1 |
| 1 | 4 | 2 |
| 2 | 3 | 1 |
| 1 | 4 | 3 |
| 1 | 4 | 4 |
| 2 | 3 | 2 |
| 2 | 3 | 3 |
| 3 | 1 | 1 |
| 4 | 1 | 1 |
Solved! Go to Solution.
@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])))
@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] )
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.
Proud to give back to the community!
Thank You!
@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] )
@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])))
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.