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

yg1982 1 Reputation point
2022-04-23T10:03:59.803+00:00

Hi,

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.
37,744 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-04-23T12:54:12.14+00:00

    Power query is not currently supported here on Q&A. The product group for Power Query actively monitors questions over at
    https://community.powerbi.com/t5/Power-Query/bd-p/power-bi-services

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

    0 comments No comments