Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Power Query -> Transform Comma to Period and Obtain Decimal Numbers

I'm working within Excel Query Editor (Power Query) and I have a table with many columns.

Some of the numbers in those columns have a period (".") and they are properly recognized as decimal numbers, but some of them have a comma (",") and they are seen as text.

I'm trying to use Query Editor's Replace Value function in order to replicate Excel's Find and Replace function (CTRL+H) and simply change the "," with "." but without any luck so far.

Do you know a fix to this, please? Thank you very much.

like image 582
jb007 Avatar asked Jan 11 '16 04:01

jb007


2 Answers

Managed to solve it in 3 steps: 1. Data Type: Text 2. Replace Values: "," with "." 3. Data Type: Decimal Number

like image 114
jb007 Avatar answered Nov 14 '22 22:11

jb007


Use transform with locale settings:

= Table.TransformColumnTypes(#"Promoted Headers", {{"title", type number}}, "en-US")

Source: https://eriksvensen.wordpress.com/2018/07/02/powerquery-how-to-handle-different-decimal-separator-when-importing-csv-files/

like image 43
Dmitry Avatar answered Nov 14 '22 20:11

Dmitry