Power Query: How do I add a specific List/Vector as a Column

IamTheB

I have a simple problem. Let's assume I have the following

enter image description here

Now I want to add a specific vector or list for example (1,2,2,1) as an additional column and it should look like

enter image description here

When I add "Custom Column", how do I have to enter this list that it creates exactly this column? It should not be a index column or a calculated column because I want to specify the values depending on another column manually. It seems like it is a very simple task, but I couldn't find any solutions yet! (I feel very stupid xD)

pls help

Thank you!

horseyride
let Source = #table({"Column1"},{{"A"},{"B"},{"C"},{"D"}}),
Add = {{1,2,2,1}},
part1=Table.ToColumns(Source) & Add,
part2= Table.FromColumns(part1,Table.ColumnNames(Source)&{"Column2"})
in part2

or perhaps, if grabbing column from another table

let Source = #table({"Column1"},{{"A"},{"B"},{"C"},{"D"}}),
part1=Table.ToColumns(Source) & Table.ToColumns(Table.SelectColumns(SomeOtherTable,"Column9")),
part2 = Table.FromColumns(part1,Table.ColumnNames(Source)&{"Column2"})
in part2

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I add hyphens to specific cells in a Pandas column

Spark: How do I query an array in a column?

How to populate a column with specific value from cell in Excel query editor or Power BI query editor?

OracleSQL: How do I add a specific AND is not null OR is not null to my query

How do I add a new column into my query that displays data less that the current date?

How can I add a column to a merged table created with Power Query in Excel 2016?

How to add custom column for max date in Power BI query editor?

Power Query: how to add one to a column when a specific values appear in an other column

With specific dates AND times in a database column, how do I query for all records on a specific day?

How do i add data to a specific column in datagridview?

How do I create a new column and add text that is specific to each row in R studio?

In TSQL, How do I add a count column that counts the number of rows in my query?

How do I add characters on specific strings?

Power Query add Month Column in dependent on Index

How do I remove duplicates WITHIN a row using Power Query?

How do i add specific data in mysql?

Can I add a new column with Linear Interpolation in Power Query M?

How do I reference another table and column in another power query in Excel

How to do incremental summing in same column with Power Query?

How can I add a dynamic date column on Power BI

How do I add a WHERE clause to my query to avoid the 'unknown column in WHERE clause' error?

How do I add a column from a different table, to the results of an existing query in sql?

How to modify column in power query

Modifying specific column headers in Excel Power Query

How do I add additional columns to Excel Power Query table that uses original columns as inputs for calculations?

How do I add another column to query that needs to be filtered if I am already filtered for another column in the where clause?

How can I add a specific list column to each table within a list of tables in Power Query?

How do I sort on a second column in Power BI?

How do I add a value to all rows in a column if the column name contains a specific value