Forum Discussion
Transpose axis values in chart
- 7 years ago
Column values are always sorted alphabetically by default. You can override this by setting a sort by column in the table designer. You could create a calculated column wth a switch statement to create a numeric ordering
CategoryOrder =SWITCH( [Category]
, "Projects under $20K", 1
, Projects $21K - $50k, 2
etc...
)
Then click on the [Category] column in the field list, switch to the "Modeling" tab on the ribbon and click on the "Sort by Column" button and choose the new [CategoryOrder] column.
I also typically hide any ordering columns like this one as they are only needed for overriding the default alphabetical sorting.
The easiest way to do this would be to unpivot this data so that it's structured as follows (excluding the Total column). Then you should easily be able to put Categories on X and Year on Y
| Financial Year ending | Categories | Project Count |
| 30/06/2010 | Projects under $20K | 5 |
| 30/06/2010 | Projects $21K - $50k | 3 |
| 30/06/2010 | Projects $51k - $100k | 5 |
| 30/06/2010 | Projects over $100k | 18 |
| 30/06/2011 | Projects under $20K | 11 |
| 30/06/2011 | Projects $21K - $50k | 8 |
| 30/06/2011 | Projects $51k - $100k | 9 |
| 30/06/2011 | Projects over $100k | 14 |
- Anonymous7 years agoNot applicable
Thank you. Your solution works, except for one thing.
When applied to the chart it shows the categories in a different order than shown in the table. It appears an alphabetical order is applied to the data. I added a conditional column to try to change the order. This works only if the next level of the heirarchy is selected and it shows the heirarchical number on the x-axis. See attached.
Is there a way to show the data in the correct order, with the correct category labels?
Thanks
Steve
- d_gosbell7 years agoSuper User
Column values are always sorted alphabetically by default. You can override this by setting a sort by column in the table designer. You could create a calculated column wth a switch statement to create a numeric ordering
CategoryOrder =SWITCH( [Category]
, "Projects under $20K", 1
, Projects $21K - $50k, 2
etc...
)
Then click on the [Category] column in the field list, switch to the "Modeling" tab on the ribbon and click on the "Sort by Column" button and choose the new [CategoryOrder] column.
I also typically hide any ordering columns like this one as they are only needed for overriding the default alphabetical sorting.
- Anonymous7 years agoNot applicable
Thank you. I was also able to apply the same approach to the conditional column that I had created initially. I did not work until I used the Sort by Column command.
Steve