Forum Discussion
Matrix Sort Date Newest To Oldest
Hi all,
Is it possible to sort week ending's in a matrix Newest to Oldest
I have tried sorting Week Ending by Week number but it won't let me as there are multiple of the same week number across different years.
I need most recent dates / weeks at the start of the matrix.
2 Replies
- amitchandak
Super User
HenryJS , Create columns like these
Week ending 1 = [week ending]
week ending rank = rankx(all(Table), [week ending] ,,desc,dense)
now mark week ending rank as sort column of Week ending 1 and use that in visual
sort column - https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- v-robertq-msft
Community Support
Hi, HenryJS
According to your description, first, you want to sort Week Ending by Week number but failed because of different years, I think you can create a calculated column to connect year with week number to distinguish with other years. Like this:
Year-Weeknum = YEAR([Date])&"-"&WEEKNUM([Date],2)Then you want to make the Matrix sorted by the value of the column(end of the week), but according to my test and research, I guess that Power BI matrix still don’t have this feature, you can click here to vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=1513f45d-a47a-4326-adbe-8bb0023da6c8
Here are some other solutions about this problem, you can take a look and have a try:
https://www.biinsight.com/quick-tips-how-to-sort-matrix-by-column-in-descending-order/
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.