Forum Discussion
Brotedo
Helper I
4 years agoCustom Sort for Matrix Column - Alphabetical but Move 1 Entry to End
I have a table with multiple entries, and I need a custom sort that keeps the alphabetical order, but always moves 'Other' to the end. So this:
| Data |
Apple |
| Banana |
Orange |
| Other |
| Pear |
| Squash |
Should become this:
| Data |
Apple |
| Banana |
| Orange |
| Pear |
| Squash |
| Other |
Hi Brotedo
Here is a sample file with the solution https://www.dropbox.com/t/UlPm1CBMkhWfRtnZRank Measure = VAR SelectedData = ALLSELECTED ( Table1[Data] ) VAR CurrentData = SELECTEDVALUE ( Table1[Data] ) RETURN IF ( CurrentData = "Other", COUNTROWS ( SelectedData ) + 1, RANKX ( SelectedData, CALCULATE ( SELECTEDVALUE ( Table1[Data] ) ),, ASC, Dense ) )
1 Reply
- tamerj1
Community Champion
Hi Brotedo
Here is a sample file with the solution https://www.dropbox.com/t/UlPm1CBMkhWfRtnZRank Measure = VAR SelectedData = ALLSELECTED ( Table1[Data] ) VAR CurrentData = SELECTEDVALUE ( Table1[Data] ) RETURN IF ( CurrentData = "Other", COUNTROWS ( SelectedData ) + 1, RANKX ( SelectedData, CALCULATE ( SELECTEDVALUE ( Table1[Data] ) ),, ASC, Dense ) )