Forum Discussion
Matrix Column Head Order
- 9 years ago
Anonymous
We can do that with following steps. Assuming we have a table like below. We can add a reverse index.
Close and apply Query Editor, select the Type column and make it sort by column of Index.
Now the order of the column heads will follow the Index.
If you want to put it in a custom order, you can customize the index yourself. For example, you can create a conditional column in Query Editor.
Best Regards,
Herbert
I went about this a different way, seems effective so far.
I have my three main regions "AMERICAS", "EMEA" and "APAC".
The sort keeps trying to put them in:
AMERICAS
APAC
EMEA
I want:
AMERICAS
EMEA
APAC
I tried the table method with sorting, but that broke some of my measures.
Here is what I did:
I built my matrix table, then I clicked on the "Columns" dropdown, then clicked "New Group":
From there, I created one group per value - Important here: Name the groups with the index prefix ( ie. 1:, 2:, 3: ):
Once complete, the columns come in with the prefixed index. This will sort based on the index you specify in the grouping.
This is nice and clean because it doesn't affect your data for filtering, grouping, etc, and is pretty simple to implement.
- S1840197 years agoAdvocate III
Anonymous Maybe this will help. Create an index column like this:
Ordercol = if('tablename'[region] = "AMERICAS", 1,
if('tablename'[region] = "EMEA", 2, 3)).
This order column then can be treated like an indicies. Now make sure that the column is a number so go to modeling and change the data type to whole number.
Then select the region field and and make sure it is highlighted in the field list. Next, go to modeling and then in the banner, look for 'Sort' and choose 'Sort by Column' and this time select Ordercol as your sort order. Please let me know if this doesn't work.
- SpredSheetAaron3 years agoNew Member
This results in a Circular Dependency.
- Tuyenbui3 years agoFrequent Visitor
Thank you! I worked very well for me.
- CuriosiT2 years agoNew Member
Perfect! Thanks so much! 🙂
- Sharmarohit12 years agoFrequent Visitor
Thanks its work like a magic