Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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])))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |