Power-Query - Change data type of all columns in a table

yg1982 1 Reputation point


If I want to transform the data type of all columns in a table (the number and the name of the columns can change in the future).
In another question I found the following solution
let Source = Excel.CurrentWorkbook(){[Name="YourTable"]}[Content], LSTHeaders = Table.ColumnNames(Source), HowMany = List.Count(LSTHeaders), Transformation = Table.TransformColumnTypes( Source, Table.ToRows(Table.FromColumns({LSTHeaders, List.Repeat({type number}, HowMany )}))) in Transformation

It works fine but I don't know how to apply "en-US" data format.
I tried the following but didn't work:

 Transformation = Table.TransformColumnTypes( Source, Table.ToRows(Table.FromColumns({LSTHeaders, List.Repeat({{type number}, "en-US"}, HowMany  )})))

Any help? Thanks

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
27,015 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dave Patrick 352.3K Reputation points MVP

    Power query is not currently supported here on Q&A. The product group for Power Query actively monitors questions over at

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments