Creating Date Data-Type based on Year and Month Text


I have a CSV file with columns that have Year column and Month Column.
But when I try to sort this in Excel or PowerBI the way it is, it does not sort in Chronological Order.

So the data looks like this:
Year | Month
2007 | Apr
2007 | May

This Year column spans over 5 to 6 years.

I was wondering how to put the Year-Month together as a Date data type.
But in Excel or PowerBI, not sure if you can sort just based on these 2.
Looking online, I see a lot a people putting in a default DAY as well.

So hope there is some way to create a Date type so that one can Sort Chronologically.


Here is one way to do it based on converting the month to a number first:

datesort.transform (2.3 KB)