Forum Discussion
Matrix Sort by Column Header Date Descending
- 4 years ago
Hi, a68tbird ;
I tested it , product as rows, sales as values, date as column;
If the column is Date Hierarchy, sort by column is not work ,so we should change the different column about year and month.
create a rank column.
Column =RANKX('financials',YEAR('financials'[Date]),,DESC,Dense)The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Everything that I'm reading, seems to suggest that this should work. I decided to create a brand new report, new sample data, and try it again from scratch. With my data imported, I created two calculated columns:
DateSort = sampleData[RecognitionDate].[Date]Rank = RANKX(sampleData,sampleData[RecognitionDate],,,Skip)
I then sorted the DateSort date by Rank. This displays correctly in the Data view (most recent sales date is ranked 1). I then add three fields to a matrix: Products as Row, StoreTotal as Value and DateSort as Columns. The matrix still has oldest year leftmost in the grid.
I've followed a suggestion from this post: Solved: Sort date field in Matrix column header descending - Microsoft Power BI Community but it's not working for me. Does the fact that I'm using a Date Hierachy in the matrix make a difference?