Forum Discussion
wnicholl
6 years agoResolver II
Sorting Issue
Sorting Issue I’m having issues with sorting the yearly brackets in my column chart. I tried to create a conditional column in query editor, however the supporting built off a few calculated col...
- Anonymous6 years ago
Year Brackets Order = SWITCH(TRUE(), 'your_table'[Years as Member] <= 10, 10, AND('your_table'[Years as Member] >= 11, 11, AND('your_table'[Years as Member] >= 21, 21, AND('your_table'[Years as Member] >= 31, 31, AND('your_table'[Years as Member] >= 41, 41, AND('your_table'[Years as Member] >= 51, 51, AND('your_table'[Years as Member] >= 61, 61, AND('your_table'[Years as Member] >= 71, 71, AND('your_table'[Years as Member] >= 81, 81 )In both tables create such a column and you're done. You'll use the column as the sorting column (hidden).
Best
D
- Anonymous6 years agoInstead of looking up, which by the way is a slow process, create one table with all the combinations, or relevant combinations, and then you'll have just one column which you can sort any way you want. Sometimes the answer does not lie in DAX but in the data model. Just change the model.
There is a way to arbitrarily sort a measure's values but that requires stunts in the code, namely, attaching non-breaking invisible zero-width spaces to the values returned by the measure. You don't want to go that route.
Best
D
Anonymous
6 years agoNot applicable
If you can add an index column and use that for the sort instead of your actual column you can get it to sort how you want. If the data is already sorted correctly in power query, you can go to add columns and add an index column.
Once you've brought that into your dataset you can change which column your calculated columns are being sorted by in the Modeling tab. (Select the column you want sorted, then click on Sort By at the top and select the new index column)