Forum Discussion
Nozama
1 year agoHelper I
Sorting column display order
Is there any way I can get PowerQuery to recognise that these column headers are MMM-YY and sort them in a timeline fashion? I have this kind of data for 10+ years and it changes dynamically, so look...
- 1 year ago
Hi, here's the M code solution for the question. I am attaching three images. One for the source data, next for the output and last one for M code.
techies
1 year agoSuper User
Hi Nozama
You have to create a sort column using this formula:
MMM_YY_Sort = YEAR([Date]) * 100 + MONTH([Date])
Then, go to your MMM-YY column, open the Column Tools in the ribbon, and under Sort By, select this newly created sort column (MMM_YY_Sort).
This ensures the MMM-YY text column displays correctly while sorting in chronological order.