Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Experts,
Is there a way to add an index column in power bi desktop's table/matrix visual which dont have filter affect while using filters for other columns.
Thanks in advance
Solved! Go to Solution.
Thanks all for providing your inputs, i have recently came across a solution, it uses visual calculation as below:
index = IF(
ISATLEVEL([Quarter]),
ROWNUMBER([year])
)
Hi,
This measure should work
S. No. = ROWNUMBER(ALLSELECTED(Data),ORDERBY(Data[Date Presented]))
Data Presented is a column which you have dragged from the Data table into the visual.
Hi @vat2do,
Thanks for reaching out to the Microsoft fabric community forum. As @MarkLaf, @ryan_mayu, @Shahid12523
and @FBergamaschi all have shared varied approaches depending on whether you want the index to be fixed at load-time or calculated inside the model. Kindly go through their responses and check the one that matches what your need.
I would also take a moment to thank @MarkLaf, @ryan_mayu, @Shahid12523 and @FBergamaschi, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Thanks all for providing your inputs, i have recently came across a solution, it uses visual calculation as below:
index = IF(
ISATLEVEL([Quarter]),
ROWNUMBER([year])
)
Hi @vat2do,
As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.
If yes, you are welcome to share your workaround so that other users can benefit as well. And if you're still looking for guidance, feel free to give us an update, we’re here for you.
Best Regards,
Hammad.
We probably need some sample data (pasted in as table that we cany easily copy) and a clear example output/behavior.
As a simple example that perhaps is along the lines of what you are looking for, consider the following table.
Example
| Column1 | Column2 | Column3 |
| 1 | A | Z |
| 1 | A | Z |
| 1 | B | Z |
| 2 | B | Z |
| 2 | C | Z |
| 2 | C | Y |
| 3 | D | Y |
| 3 | D | Y |
| 3 | E | Y |
If we want to add an index based on a certain sort of one of the columns that is not impacted by filters on the other columns, the RANK function may be the most straightforward to use.
For example, if we want an index based on Column2 (this would work as a measure or a calculated column):
Column2 Index = RANK( ORDERBY( Example[Column2], ASC ) )
Option 1: Calculated Column (DAX, static)
Index = RANKX(ALL('YourTable'), 'YourTable'[UniqueID], , ASC, DENSE)
ALL() ensures it’s unaffected by filters.
Option 2: Power Query (static)
In Transform Data → Add Column → Index Column → From 1
Keeps a fixed index regardless of filters.
Option 3: Measure (dynamic, ignores slicers)
Index Measure = RANKX(ALL('YourTable'), 'YourTable'[UniqueID], , ASC, DENSE)
We can Add an index column in Power Query (Add Column > Index Column).
This index is static, but when you filter your visual, the index will show the original row number for the filtered rows (not a continuous sequence).
If you want a dynamic row number that always starts at 1 for the visible rows:
Row Number =
RANKX(
ALLSELECTED('Table'),
[SortColumn],
,
ASC,
DENSE
)
if this does not work, pls provide some sample data and expected output.
Proud to be a Super User!
Thanks ryan,
I have already tried this measure but the output is all 1's not in series like 1,2,3,4...... (i need a dynamic index column )
then you can try this
Proud to be a Super User!
Hi @vat2do,
sure you can add an index column but in Power Query.
You can use the command here shown, after clicking on Transform Data in Power Bi Desktop and select the table on which you want to add it
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.