Forum Discussion
Order columns in matrix
Helloo!
I've want to include 4 columns in a matrix but unsure how to order the columns so they are in date order? My column headers are like this:
| Q1 2020 | Q2 2020 | Q3 2019 | Q4 2019 |
Right now it's alphabetical but need them to be Q3 2019, Q4 2019, Q1 2020, Q2 2020.
Does anyone know if this is possible whilst still only displaying the header text as it is right now?
Anonymous , Create sort for for that
like 2019q1 or 20191
qtr sort = format([Date],"YYYYQ")
and sort qtr on this column
In case you need desc sort. create a desc rank on qtr sort and sort qtr on that
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
9 Replies
- amitchandak
Super User
Anonymous , Create sort for for that
like 2019q1 or 20191
qtr sort = format([Date],"YYYYQ")
and sort qtr on this column
In case you need desc sort. create a desc rank on qtr sort and sort qtr on that
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- AnonymousNot applicable
amitchandak Thanks for your reply - I don't have sort by columns as an option anywhere on Power BI?
- lkalawski
Resident Rockstar
Anonymous
Are you using Live Connection or Import?
To see the Sort by Column option, you need to select the column on the right, and then an additional Column Tools tab will appear.
_______________
If I helped, please accept the solution and give kudos! 😀
- Greg_Deckler
Community Champion
Anonymous - You will need to use a Sort By column I believe.
- lkalawski
Resident Rockstar
Hi Anonymous
You need to add an additional column in the table you are retrieving data from. This column should contain numbers from 1 to n - to sort the values. Then in the Model view, click on the column with dates and select "Sort by Column" - (Column Tools tab and Sort section) and select the column with numbers.
If you do this, remember to select the sort column on the matrix with dates - if you do, you can additionally set whether it should be ascending or descending.
In case of problems, I can send screenshots with the steps.
_______________
If I helped, please accept the solution and give kudos! 😀