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
MS3
Frequent Visitor

SORT MATRIX BY YEAR AND SHOW YEARS IN THE COLUMN

 

Hi!

 

I am trying to do a matrix that contains the years 2017, 2018 and 2019. It is sorting the years in this order (2017, 2018 and 2019). I want the order to be 2019, 2018 and 2017.

 

I have used the function of Rank - as suggested in a similar post- to create an additional column in my table with the Rank. The same succesusfuly has put the Rank as 1 for 2019 2 for 2018 and 3 for 2017.

 

If I select the column Rank in my matrix, yes I can see the years ordered as 1, 2 and 3. The catch is the name of the column is 1,2 and 3, but I would still like this to be 2019, 2018, and 2017.

 

Is there a way to ensure the order is 2019, 2018 and 2017, but that these are the labels in the Column?

 

The help is much appreciated.

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @MS3 ,

 

We can try to create two calculated column to meet your requirement:

 

Year-Shown = [Year]

 

Year-Rank = RANKX('Table',[Year],,DESC,Dense)

 

Then we can make [Year-Shown] Sort by the [Year-Rank] column, and use [Year-Shown] column inside the matrix visual:

 

2.jpg3.jpg


Best regards,

 

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-lid-msft
Community Support
Community Support

Hi @MS3 ,

 

We can try to create two calculated column to meet your requirement:

 

Year-Shown = [Year]

 

Year-Rank = RANKX('Table',[Year],,DESC,Dense)

 

Then we can make [Year-Shown] Sort by the [Year-Rank] column, and use [Year-Shown] column inside the matrix visual:

 

2.jpg3.jpg


Best regards,

 

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Make Rank as sort column.

Sort_by_column.pngSortnewribbion.png

 

Appreciate your Kudos.

Greg_Deckler
Super User
Super User

Have you tried a Sort By column?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes, I did this. So it sorts correctly, but my headers are still the Rank position as opossed to the Year itself (e.g. 2019)

v-lid-msft
Community Support
Community Support

Hi @MS3 ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 @MS3 , If possible please share a sample pbix file after removing sensitive information.Thanks.

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.