Forum Discussion
number each row
Hello All,
I been trying to assign a number from 1 to the last row on each row on my table, I tried with Countrows but only gives me the total number of rows on each row.
There is a way to do what I need?
Thanks in advance
This is the column that I createdThis is the result, however what I need is that each row contain the number of row that is, from 1 to the end of the table
Hi Lu1sT0rr3s
You can do this very easily in the query editor: Add Column-> Index column
If you want to do it in DAX you need to have a way to establish an order between rows and I do not see it from the data you are showing
Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
2 Replies
- AlBCommunity Champion
Hi Lu1sT0rr3s
You can do this very easily in the query editor: Add Column-> Index column
If you want to do it in DAX you need to have a way to establish an order between rows and I do not see it from the data you are showing
Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
- Lu1sT0rr3sFrequent Visitor
Thanks AlB it works very well.
I will keep present your advice, I'm new using the application and there is a lot of things that I still dont know.