Forum Discussion
Power Query - Extract an Existing Column Name and put it in a new Custom Column
- Anonymous8 years ago
OK in that case your custom column's formula should be
= List.First(Table.ColumnNames(#"Insert Previous Step Here"))
...for whatever the previous step was. I'm going to guess it's #"Renamed Columns" or #"Changed Type" or something like that.
Which column name? Short of you typing in the name of the column, how is the query supposed to determine which column's name to use?
- ViorelCa8 years ago
Helper I
Sorry, let's say we have Column A, ColumnB and Column C.
I want to make a new conditional column (D) that is filled with this text: "Column A"
Many thanks!
Viorel
- ViorelCa8 years ago
Helper I
Is there a function that extracts the name, something like Comun. Name ("Column A")?
- Anonymous8 years agoNot applicable
I'm not sure why you would want to extract the text from the column header if you already are referring to the column by its name. Wouldn't you expect your hypothetical formula Column.Name("Column A") to return "Column A"? Why not just make a column that contains the text "Column A"? Why would you need to extract the same text you're already typing in?
- Anonymous8 years agoNot applicable
Go to Add Column, hit the Custom Column button and in the formula box type
= "Column A"