The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have a table in Power Query which has a text field with dates in the format "MMM-YYYY". The issue I'm having is that when I create a pivot table, it sorts this field in Alphabetical order with "Apr-2023" on top. I need a way to sort it correctly with "Jan-2023" on top.
Hi,
you'll probably need to create a sort order column and then use sort by column on the column tools ribbon on you current field. The easiest way to do it would be to add a new date field, spliting out the month and year and adding the day 01 to the begining.
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
or use Date.FromText([Date Field]) in custom column in power query to create the column
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
The same issue occured for me;
I think if you convert to date as DOLEARY85 says, then sort then pivot iot should work. Mine was to summarise hours for week ending.
Advanced editor steps here;
#"Sorted Rows2" = Table.Sort(#"Replaced Value",{{"Week Ending Sunday", Order.Ascending}}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Sorted Rows2", {{"Week Ending Sunday", type text}}, "en-AU"), List.Distinct(Table.TransformColumnTypes(#"Sorted Rows2", {{"Week Ending Sunday", type text}}, "en-AU")[#"Week Ending Sunday"]), "Week Ending Sunday", "Hours", List.Sum)