Forum Discussion
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
- Anonymous5 years ago
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
4 Replies
- amitchandak
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
- rbhattacharya
Helper I
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
- AnonymousNot 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:
Steps
- create a duplicate column [Year-month copy ]from [year month ]text type
- create a calculated column -> sort for matrix = -1*int(dummy[Year Month - Copy])
- now sort your [Year-Month] column by calculated column sort for matrix.
BOOM! works like a charm.
- AnonymousNot applicable
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