Forum Discussion
Gerald23
5 years agoHelper I
Change column types dynamically
Hi Everyone, I have an issue with changing column types in the Power Query Editor. Normally i change them in the UI but this time my column names can change and there can be more or less columns...
- 5 years ago
Your Changed Type step should be:
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers", List.Transform( List.RemoveFirstN( Table.ColumnNames(Source), 13 ), each {_, Currency.Type} ))
Jakinta
5 years agoSolution Sage
Your Changed Type step should be:
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",
List.Transform(
List.RemoveFirstN(
Table.ColumnNames(Source),
13
),
each {_, Currency.Type}
))
- Gerald235 years agoHelper I
Tested and this works thanks for the help 🙂
- RaiSta3 years agoNew Member
Hi, great solution!
Only, I'd like to know, how to use this 'List.Transform'-function with regional code (for instance "en-US" in case the system is not in US-american setting) - how to get this into the List.Transform-function?Thanks in advance,
RaiSta
- RaiSta3 years agoNew Member
... just found the answer by chance...:
= Table.TransformColumnTypes(>table<, List.Transform(>List-of-columnheads<, each {_, Number.Type}), "en-US")