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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.