Forum Discussion
Sorting column display order
- 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.
Hello Nozama ,
You can do it on the power query screen. Here are the examples:
The data:
Unpivot other (Cat)
Add a year. İf you don't, power query understands it is current year.
Change the type:
Kind Regards,
Gökberk Uzuntaş
📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!
🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |
Great, thanks! My apologies, I should have been more clear. The headers are supposed to be MMM-YY. So Feb-27 is February 2027, Mar-27 is March 2027, Jun-27 is June 2027, Oct-25 is October 2025, Mar-26 is March 2026 and Mar-28 is March 2028. So I want them to be sorted as Oct-25, Mar-26, Feb-27, Mar-27, Jun-27 and Mar-28, in chronological order. These will change from time to time so hoping for an automatic solution. Hope that makese sense!