Forum Discussion
2 Errors: Unknown column and Key not present in dictionary
Hello
I met the same problem, fix it by 2 hours google and guess.
In short, adding code below in red&blod in your advance editor and blame MS for their casual document.
MySQL.Database("10.181.165.202", "pobot", [ReturnSingleDatabase=true, Encoding=TextEncoding.Utf8])
if you interest, go on for my story 🙂
Frist, I googled and got ticket https://community.powerbi.com/t5/Desktop/Display-Import-Mixed-Character-Set/m-p/277909 , from accepted answer of this link, I realized that I should change code at advance editor, quite simple code as following there:
let
Source = MySQL.Database("10.181.165.202", "pobot", [ReturnSingleDatabase=true]),
pobot_fb_issues_final = Source{[Schema="pobot",Item="fb_issues_final"]}[Data]
in
pobot_fb_issues_final
so, the only possible place need to be updated is powerquery function MySQL.Database, so I checked its function meta-type from mysql-database . where Encoding : A TextEncoding value that specifies the character set used to encode all queries sent to the server (default is null) was known. so seems something like this:
MySQL.Database("10.181.165.202", "pobot", [ReturnSingleDatabase=true, Encoding="utf8"])
may work, but unfortunately, it hinted me:
DataSource.Error: MySQL: This function doesn't support the query option 'Encoding' with value '"utf8"'.
Neighter for UTF-8,utf8mb4,...
after serveral failed try, I reminded that encoding may be number from the question of
https://social.technet.microsoft.com/Forums/en-US/7b29d033-6230-4fa0-aafc-8313ea771f24/change-encoding-for-import-csv-file-in-power-query which was menthion by answer of last link. from the second ink, line: How change encoding from 1251 to 65001 (utf-8) posted, so I got that encoding maybe represented by number. So, I tried
MySQL.Database("10.181.165.202", "pobot", [ReturnSingleDatabase=true, Encoding=1251].
But it stll hinted me by error:
Expression.Error: The value for a 'TextEncoding.Type' enumeration was not one of the allowed values: 'TextEncoding.Utf8, TextEncoding.Utf16, TextEncoding.Ascii, TextEncoding.Unicode, TextEncoding.BigEndianUnicode, TextEncoding.Windows'.
so, I tried
MySQL.Database("10.181.165.202", "pobot", [ReturnSingleDatabase=true, Encoding=TextEncoding.Utf8]).
Bang, it worked.