Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sertim
New Member

incremented if

Hi!

I have table with column 'owner'.

I need to make 'index' which is incremented if the owner is equal to 'G' :

owner   ...   index

G                  1

S                  1

G                  2

S                  2

G                  3

T                  3

T                  3

T                  3

T                  3

S                  3

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sertim,

 

I think you need to add an original sort index column to let the formula loop through the table.

 

 

Below is the sample.

 

Original table:

1.PNG

 

Write calculated column to calculate index based on id.

Index = COUNTROWS(FILTER(ALL('Sample'),[ID]<=EARLIER([ID])&&[Owner]="G"))+0

Result:

2.PNG

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sertim,

 

I think you need to add an original sort index column to let the formula loop through the table.

 

 

Below is the sample.

 

Original table:

1.PNG

 

Write calculated column to calculate index based on id.

Index = COUNTROWS(FILTER(ALL('Sample'),[ID]<=EARLIER([ID])&&[Owner]="G"))+0

Result:

2.PNG

 

Regards,

Xiaoxin Sheng

It works!

This is what I need.

Many thanks.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.