Forum Discussion
Add Number to a Column
Dear Juampe,
Use the below DAX Expression in the calculated column. Table1 is the Table Name and Index is the column name where you have row number.
= CALCULATE ( COUNT ( Table1[Index] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Index] <= MAX ( Table1[Index] ) ) )
Hope this information helps a lot.
Regards,
Pradeep
Thanks for the response but didn“t work
- Anonymous7 years agoNot applicable
Dear Juampe,
I will provide you the simplest way to do this.
1. Go to your dataset and click on the ellipses (...) and select edit query.
2. Then, go to Add column Menu on the top and select "Custom" value from Index Column option.
3. Enter starting Index is 1 and Increment is 1. Click on OK.
4. Go to Home Menu and Click on Close & Apply option
5. You are set to go. The above steps will create an index column in your Dataset and you are good to go.
Regards,
Pradeep
- Anonymous7 years agoNot applicable
Thanks for adding more stages
Now I have the following reslut
I still havent got the numbers in order.
I want 1,2,3,4,5 dependign the total rows that I have in the tableRegards
- v-piga-msft7 years agoResident Rockstar
Hi Anonymous ,
I have a still confused about your requirement.
If I understand your scenario correctly that you want to create an index column in your table?
If you just create an index column for all of the rows for your table you could create the index column in Query Editor which Pauwnrajpp has mentioned.
If you want to create the index column based on the rank of the specific column, you need create a dax formula with Rankx function.
Please have a reference of this similar thread.
If you still need help, please share your data sample which could reproduce your scenario and your desired output.
Best Regards,
Cherry