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
SBC
Helper III
Helper III

Index Column Based on Filtered Data in Table Visual

Hi

I have a table visual with three columns of data in Power BI, and I would like to add an index column that starts from 1 and increments by 1 up to the number of rows in the Name column. Specifically, when the data in the table is filtered, the index column should update to reflect the number of rows in the filtered result.

Name- calculated column from app table and contains duplicates

Age- measure

City- measure

Index- start the sequence from 1 and ends at the no of rows of the name column in the table visual. Duplicates should not effect the sequence.

Sample Data (Before Filtering):

Index

Name

Age 

City

1

John

25

New York

2

 Alice

26 

London

3

Bob 

22 

Tokyo

4

John

28 

Berlin

5

Michael

15 

Sydney

Sample Data (After Filtering for "Age > =25"):we use slicer for the filter purpose

Index

Name

Age

City

1

John

25

New York

2Alice26London
3

John

28 

Berlin

 

As you can see, the index should reset based on the filtered data, providing a new row number for each filtered result.

Could someone suggest the best way to implement this dynamic index in my Power BI report? Thank you!

 
1 ACCEPTED SOLUTION
Arul
Super User
Super User

@SBC ,

try this measure,

Index Measure = RANKX(ALLSELECTED('Sample'),CALCULATE(MAX('Sample'[Age ])),,ASC,Dense)

Arul_0-1729753845857.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

1 REPLY 1
Arul
Super User
Super User

@SBC ,

try this measure,

Index Measure = RANKX(ALLSELECTED('Sample'),CALCULATE(MAX('Sample'[Age ])),,ASC,Dense)

Arul_0-1729753845857.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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.