Forum Discussion

Schch's avatar
Schch
Frequent Visitor
1 year ago
Solved

Data Type conversion problem for DATE in Power Query on au.finance.yahoo.com

Hi, I found that the Data type conversion for Date in Power Query did not work from Sept for the web source :  https://au.finance.yahoo.com/quote/%5EHSI/history/.   Any clue to this   ...
  • moncx's avatar
    1 year ago

    Hey Schch ,

     

    as Alex87 said promote first row to headers, you can find how to do that here: Promote or demote rows and column headers (Power Query) - Microsoft Support

     

    And then you get error because 'Sept' is not official shortened version of september - it should be 'Sep'. So before you change column type to date add a step and replace 'Sept' to 'Sep' (instructions: Replace values (Power Query) - Microsoft Support) or just use this M code:

    = Table.ReplaceValue(#"Changed Type","Sept","Sep",Replacer.ReplaceText,{"Date"})
    After that just check if other months use correct short version of the month and if not change it in the same manner before converting to date type.

     

    Hope it helps!

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.