March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
Maybe a stupid question but is there a way to always have a number sort order to each table, meaning when i display some data in a table to always have 1,2,3,4,5, etc. in the beginning of the table. Ideally, not using any rankx functions as i am not ranking anything but simply would like to have the number of rows dispalyed not as a sum but by numbers. Is this possible somehow to be done in Power bi or would need to always add it manually after exporting the file? Please let me know, thanks.
Example if i now have this:
Text | Text | Text | Text |
Value | Value | Value | Value |
Value | Value | Value | Value |
Value | Value | Value | Value |
What i would like ideally to have is:
Number | Text | Text | Text | Text |
1 | Value | Value | Value | Value |
2 | Value | Value | Value | Value |
3 | Value | Value | Value | Value |
Solved! Go to Solution.
Hi, try this:
1. Add a Index Column in Power Query
2. Create a measure
indexdinamyc =
VAR index =
SELECTEDVALUE ( 'Table (2)'[Index] )
RETURN
COUNTROWS (
FILTER ( ALLSELECTED ( 'Table (2)' ); 'Table (2)'[Index] <= index )
)
3. Add this measure in your visual table
Note: Maybe is you use aggregations this need some extra adjustments.
Regards
Victor
Hi, try this:
1. Add a Index Column in Power Query
2. Create a measure
indexdinamyc =
VAR index =
SELECTEDVALUE ( 'Table (2)'[Index] )
RETURN
COUNTROWS (
FILTER ( ALLSELECTED ( 'Table (2)' ); 'Table (2)'[Index] <= index )
)
3. Add this measure in your visual table
Note: Maybe is you use aggregations this need some extra adjustments.
Regards
Victor
That seemed to work for me thank you.
Hi,
You can easily add an index column to your model.
In Power Query, use on the tab Add Column, the Button Index Column.
It should do the trick,
Thank you for the quick reply @AilleryO , sorry, maybe one point that i forgot to mention is, i will filter the values, therefore it wil not be the order of how they are in the data. So unfortuantely, index will not do the trick as it will display the number as the way the data was loaded. It will need to be dynamic, but the only way i know is using a rankx measure, but i was wondering if there was some dynamic indexing in the tables.
Hi,
You're welcome.
And the COUNTROWS function is not of any help in your case ?
Have a nice day
No unfortuntely, it doesnt seem to be working for me.
And :
SUBSITUTEWITHINDEX so you can already select your data, and then INDEX them ?
With this solution i think i will need to define the index 1 by 1 in my undertanding of how it works.
Hi,
Isn't it possible for you to create a calculated column ?
before using SUBSTITUTEWITHINDEX, to lessen the possibilities...
No, i dont think so. I think since there doesnt seem to be a function or feature that supports this at the moment in Power Bi, for my case the easiest way would be then to use a rankx function and rank a single value column.
Hi,
As far as i have known, i think there is no such function expect using ranking measure to show dynamical index.
And i think what you said is a cool idea, you can create an idea here:
https://ideas.powerbi.com/forums/265200-power-bi-ideas
Best Regards,
Giotto Zhi
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |