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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Christianvs
Helper I
Helper I

Update index when filter is applied to table

Hi

 

I am trying to figure out the best way to implement a self updating index column and I asked a question yesterday that is related to this but in a slightly different fashion. 

 

My question here is whether I can implement a index column that updates whenever a filter is applied to the table the column exists in.
So I got an index column which I have added through Power Query Editor:

Christianvs_0-1665138292755.png

Now when I apply a filter to this table, some rows are not shown which means that the index isn't going from 1 to N (number of rows) anymore:

Christianvs_1-1665138418950.png

 

Is it possible to make a measure og a calculated column that updates everytime a filter is applied to the table so the index column always shows from 1 to N?

 

Thanks

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Let the table containing the Index column be 'Index Table'

Try this measure:

 

New index =
RANKX (
    ALLSELECTED ( 'Index table' ),
    CALCULATE ( SUM ( 'Index table'[Index] ) ),
    ,
    ASC,
    DENSE
)

 

rnk.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
pthapa
Post Patron
Post Patron

I got circulare reference error.

PaulDBrown
Community Champion
Community Champion

Let the table containing the Index column be 'Index Table'

Try this measure:

 

New index =
RANKX (
    ALLSELECTED ( 'Index table' ),
    CALCULATE ( SUM ( 'Index table'[Index] ) ),
    ,
    ASC,
    DENSE
)

 

rnk.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






You are a wizard Paul! Thanks! 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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