The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
80 | |
75 | |
52 | |
50 |
User | Count |
---|---|
133 | |
124 | |
78 | |
64 | |
61 |