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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
rbhattacharya
Helper I
Helper I

Arrange matrix column header in descending order (Date Column)

Hello,

 

Please refer to the attached screenshot. Is there any way to display the date column in descending order i.e. the latest date column values should get displayed first. Through edit query mode, I tried arranging the date column in descending order, but that didn't solve the purpose. Sorting by Group Name or Employee count also didn't help. Kindly advise.

 

Regards,

Ranjeeta

 

Capture.JPG

 

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

Hi @rbhattacharya ,

 

Take a look at this blog about sorting matrix by column.

https://www.biinsight.com/quick-tips-how-to-sort-matrix-by-column-in-descending-order/ 

 

Best Regards,

Jay

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

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @rbhattacharya ,

 

Take a look at this blog about sorting matrix by column.

https://www.biinsight.com/quick-tips-how-to-sort-matrix-by-column-in-descending-order/ 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

Hello @rbhattacharya ,

 

I am not sure if it's the best solution but thats how i apply desc order for columns in matrix visual.

Data:

paraabhi17_0-1614093178204.png

Steps

  1.  create a duplicate column [Year-month copy ]from [year month ]text type
  2. create a calculated column -> sort for matrix = -1*int(dummy[Year Month - Copy])
  3. now sort your [Year-Month] column by calculated column sort for matrix.

BOOM! works like a charm.

 

 

 

 

 

amitchandak
Super User
Super User

@rbhattacharya , I have discussed this in video : https://www.youtube.com/watch?v=KK1zu4MBb-c

 

new columns

Date 1 =[Date]

Date Rank = rankx(All(Date), [Date])

 

Sort Date 1 on Date Rank and use Date 1 in visual

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

Thanks a lot for the response. I've been trying to implement using RANKX but unsuccessful till now. The date column I have is in "YYYYMM" format which is a text column to begin with. I'm trying to convert the same to a date format and then using RANKX. Somehow, the order is always ascending. Do you have any more suggestions regarding the same?

 

Regards,

RB

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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