Forum Discussion
Compare two strings alphabetically
Hello,
I have a list of activities id and subactivities id.
I want to create an index column for each activity so the table would look like this:
| Activity id | Sub-activity id | Index |
| Act-1 | 0 | |
| Act-1 | Sub-act 1 | 1 |
| Act-1 | Sub-act 2 | 2 |
| Act-1 | Sub-act 3 | 3 |
| Act-2 | 0 | |
| Act-2 | Sub-act 4 | 1 |
| Act-2 | Sub-act 5 | 2 |
| Act-3 | 0 | |
| Act-3 | Sub-act 6 | 1 |
I thought that I could just do:
Does string comes with consistent value and Numbers at last ?
You may want to split this column thru Power Query to sub activity and its number and then use the number column in the DAX expression.
3 Replies
- FarhanAhmedCommunity Champion
Does string comes with consistent value and Numbers at last ?
You may want to split this column thru Power Query to sub activity and its number and then use the number column in the DAX expression.
- AnonymousNot applicable
Yes they all begin with the three same letters and then it's all numbers.
Thank you for the answer ! I can see that this will work.
- NickolajJessenSolution Sage
Here's an alternative soloution, should you ever need it.
Step 1: Make an index coloum in power Query that sorts in alphabetically (This could require a concatenation on Activity and activityid, if your data isn't already entered in the correct order)
Step 2: