Forum Discussion
powerbricco
5 months agoAdvocate I
PQ - Create a column if Source.name column begins with
Dear All, i want to add a step in powerquery that creates a column only if Source.Name begins with letter "a". Tha is beacuse my importing mode is changed. From now on, my Source.Name is different ...
- 5 months ago
You could add a query and make a list using Table.ColumnNames(QueryTableName), then make it a table, and then add extract the first letter of each column. Then you could make a reference query for the Table Query, and make a condition like if List.Contains(ColumnNameTable[ExtractedFirstLetterColumnName], {"a"}, then Do.YourTransformation, else Do.YourOtherTransformation.
You'll need to replace my table and column names to your own, but that's the idea.
--Nate
Natarajan_M
5 months agoSuper User
Hi powerbricco , Could you please elaborate your requirement with some examples ?
Thanks