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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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