Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Keltea
Frequent Visitor

Sort Date Column ascending in a matrix

I have a matix week ending periods in the columns. I would like to sort in the descending order to show the latest date first. In the example below, I would like to see 05/09/20 on the left. I have searched this site but I did not see a solution.

 

Power BI Help2.png

 Thanks in advance for your help

1 ACCEPTED SOLUTION

Ok, Columns are tricky. You'll need to create a reverse index as this article states.

 

In your date table in Power Query, you'd do this:

  1. Sort your date table in descending order by date (Newest date at the top)
  2. Add an index column
  3. Re-sort the date table in ascending order.

Now sort your date by the index.

 

Note that will affect all visuals. You may want to create a duplicate date column in your date table for a descending sort, the use that date column in your matrix, and sort it by the Index column, and leave your original date coluimn alone. That will also make filtering on the date column easier as a Sort By affects filtering.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

Click on the elipses in the matrix visual then select the Sort By option. 

 

Select it again and the Ascending/Descending options will show up.

 

2020-05-21 10_22_12-Issue - Power BI Desktop.png



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Keltea
Frequent Visitor

Does not work - date is not an option.Power BI Help3.png

 

Ok, Columns are tricky. You'll need to create a reverse index as this article states.

 

In your date table in Power Query, you'd do this:

  1. Sort your date table in descending order by date (Newest date at the top)
  2. Add an index column
  3. Re-sort the date table in ascending order.

Now sort your date by the index.

 

Note that will affect all visuals. You may want to create a duplicate date column in your date table for a descending sort, the use that date column in your matrix, and sort it by the Index column, and leave your original date coluimn alone. That will also make filtering on the date column easier as a Sort By affects filtering.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.