Power Query Date Formate

ahmedismailfourtex

Board Regular
Joined
Apr 28, 2015
Messages
124
Hello.
i have months column contain the months in ( Jan - Feb - etic .. ) and the power query read it as a text when i change it date it give error
How to keep it ( Jan - Feb - etic .. ) with date format so i can use it in pivot tables and so.
Best regards ;)
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
One of ways:
Code:
let
    HelperTbl  = Table.Buffer(Table.FromColumns({{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},{1..12}}, {"MonthName", "Number"})),
    Source = Excel.CurrentWorkbook(){[Name="Tabela1"]}[Content],
    MonthNumber = Table.TransformColumns(Source,{{"Months",  (x) =>Table.SelectRows(HelperTbl, each [MonthName]=x)[Number]{0}}})
in
    MonthNumber


Regards

PS Here is an example file.
https://drive.google.com/file/d/0B6UlMk8OzUrxR0hVak5nMW1ONlU/view?usp=sharing
 
Upvote 0
If you have the month numbers in a separate column as well, you can use the sort by function to sort the month names by the month number. That way when you use months in a pivot table or chart it will sort by the month order correctly.
 
Upvote 0

Forum statistics

Threads
1,224,115
Messages
6,176,477
Members
452,728
Latest member
mihael546

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top