5
votes

I have a Matrix visual in Microsoft PowerBI with Australian 'States' as rows and 'Months Ago' as columns.

By default the Matrix shows my columns from 0 months ago to 12. I would like it to show from 12 months ago on the left to 0 months ago on the right.

+-------------------+-----------------------------+-------+
|                   | Months Ago                  |       |
+-------------------+-----------------------------+-------+
| State             | 0  | 1  | 2  | 3  | 4  | 5  | Total |
+-------------------+----+----+----+----+----+----+-------+
| Queensland        | 10 | 10 | 10 | 10 | 10 | 10 | 60    |
+-------------------+----+----+----+----+----+----+-------+
| New South Wales   |    |    |    |    |    |    |       |
+-------------------+----+----+----+----+----+----+-------+
| Victoria          |    |    |    |    |    |    |       |
+-------------------+----+----+----+----+----+----+-------+
| South Australia   |    |    |    |    |    |    |       |
+-------------------+----+----+----+----+----+----+-------+
| Western Australia |    |    |    |    |    |    |       |
+-------------------+----+----+----+----+----+----+-------+

Currently I am only given the option to sort by the value type fields (ie revenue etc).

Is there any option to sort/order the Column Headers?

3

3 Answers

4
votes

I don't think there is an option for you to sort column headers directly.

However, you can change the default sort order for the Months Ago column so that it will be reflected in general.

You can add a custom column MonthSrt = 12 - [Months Ago] in query editor:

MonthSrt

(It won't work in DAX because of a known issue)

Then you can select the Months Ago column and sort it by MonthSrt:

custom sort

The custom sort will be applied when you use the Months Ago column in visuals:

result

0
votes

You can also make groups (1 to 1 items) al give them al logical number:

enter image description here

The order will change automaticly in the matrix

0
votes

The following solution worked for me to display the dates in descending order in a matrix:

how to sort column dates in descending order of matrix in power bi