Forum Discussion
Carminol
Jan 03, 2022Copper Contributor
Power Query - automatically change type of data inside the column (columns have changing titles)
Dear All, I am trying to develop file that will import data from another Excel file. The table that will be imported is similar to table from below. The problem that I have is how to make my q...
- Jan 03, 2022
To change #1 and #3 on text and rest on whole number
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], columnNames = Table.ColumnNames( Source ), changeType = Table.TransformColumnTypes( Source, List.Transform( columnNames, each if List.PositionOf(columnNames, _) = 0 or List.PositionOf(columnNames, _) = 2 then {_, type text} else {_, Int64.Type} ) ) in changeTypeNames of columns and their number don't matter.
Carminol
Jan 04, 2022Copper Contributor
Thank you, it works perfectly 🙂
SergeiBaklan
Jan 04, 2022Diamond Contributor
Carminol , you are welcome