Forum Discussion
problem with sorting in a matrix
Hi,
In a matrix I have a date and another field in columns, other 2 fields in rows and a measure in value.
If I try to sort by date I don't have the option, why?
If I put date in rows I can but if it's in columns and I add fields on rows I can't
thank you
Make sure you create another (helper) date column with date type "date" in the same table using dax or Power Query.
Using DAX:
date_field = DATEVALUE(date_text)
Then sort the field with date as text using the date field with date datatype.
Go to model view then select the datetext field and sort by date(date type) field
4 Replies
- amitchandakSuper User
Giada_Togliatti , There is no sort option for the column. By default ascending sort . If you want a different sort order use sort column
example
Date 1 = [date]
Date Rank = Rankx(all(Date), [Date])
Sort Date 1 on Rank and use date 1
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.- Giada_TogliattiPost Patron
amitchandak , themistoklis the problem is that the date column in real data is a text, which formula can I use to have a text column in descending order?
- themistoklisCommunity Champion
Make sure you create another (helper) date column with date type "date" in the same table using dax or Power Query.
Using DAX:
date_field = DATEVALUE(date_text)
Then sort the field with date as text using the date field with date datatype.
Go to model view then select the datetext field and sort by date(date type) field
- themistoklisCommunity Champion
Try the methodology from this link:
https://www.biinsight.com/quick-tips-how-to-sort-matrix-by-column-in-descending-order/