Forum Discussion
Anonymous
6 years agoNot applicable
Sort column by multiple columns
Hi, I was wondering if it was possible to sort a column based on two columns? In the example below I'm trying to sort the Category by the Sort_Order column. The problem is that the sort order...
- 6 years ago
Hi Anonymous ,
You could create a rank column to sort category.
Rank = RANKX ( 'Table', 'Table'[Group] * 10 + 'Table'[Sort_Order],, ASC, DENSE )
az38
Community Champion
6 years agoAnonymous
Do you create measure or column?
If column, there shouldn't be such error
Anonymous
6 years agoNot applicable
Hi az38 ,
I added it as a column and it certainly sorts the data correctly; However the issue I still have is that I can't specifically sort the 'Category' by this column. So if I was to add 'Category' to a slicer it still defaults the sort order alphabetically, but I would want it sorted by the new 'Surrogate Order Column'.
Thanks again for your help.
Ashley
- az386 years ago
Community Champion
Anonymous
try this technique https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column