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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Syndicate_Admin
Administrator
Administrator

Table of Contents in Visual Table

Good!

I have a report in Power BI where I show student data with the following columns:

  • Generation
  • Student Name
  • Registration
  • Benefit
  • Pass Rate

The first 4 columns use a table with student data and the "Pass Rate" column is from a table that was created directly from the BI and is configured with calculated columns, where that is recorded as a pass rate (this is in %).

Now I have the problem that I have to generate a column in that visual that works as an "Index" and that when I use the filters within the table, this column only shows me the row number in a sequential way. For example:

WhatsApp Image 2024-03-11 at 12.23.31.jpeg

My problem is that, if I sort any of the columns (except the ID one), these numbers are mixed with each other and I need you to only list the rows that are showing and that regardless of the order that they give in the others it continues to be maintained or otherwise, that when I sort by Approval Rate (from highest to lowest) it shows me the index in a correlative way and the amount of rows you're displaying.

Example of the error:
WhatsApp Image 2024-03-11 at 12.25.27.jpeg

It happens that using several formulas (RANKX, INDEX, among others), it happens to me that only 1 appears, this repeats the data when I add it to the visual among many errors that I have not been able to understand and the solutions that I have sought and adapted have not borne fruit in my report.

If anyone has any ideas or knows how to make that index I would be very grateful!

2 REPLIES 2
Anonymous
Not applicable

Hi @Syndicate_Admin 

 

It seems that you want to create an "index" column to display the row numbers in order, based on the data being filtered or sorted.

 

For your question, here is the method I provided:

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1710208026970.png

 

Create a measure. Sort the pass rate from highest to lowest based on your filtering, marking it as an indexed column.

 

index_rankx = 
    RANKX(
        ALLSELECTED('Table'), 
        CALCULATE(
            MAX('Table'[Pass Rate])
        ),
         , 
         DESC, 
         Dense 
    )

 

Put the measure into visual and manually sort the Pass Rate.

 

Here is the result.

 

vnuocmsft_1-1710208945369.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Good morning!

The measure works in a way, but the following happens to me:

Here's the data without the index when you push it into the table visual:

GonzaloP_0-1710245143798.png

When I enter the measurement you provided, the following happens:

GonzaloP_1-1710245189047.png

The rows shown in the report are duplicated, regardless of the filters I have applied to the sheet and table.

I tried applying the filter directly to the measure, but it doesn't work either, it keeps duplicating the data in the report that is shown.

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.