Forum Discussion
M Language Add New Column
- 4 years ago
As Nathaniel_C points out, in order to add columns from another table, you generally merge the tables and expand the columns you're interested in.
Joining on a range makes this significantly more involved. Radacad has a good article on a very similar problem:
https://radacad.com/dates-between-merge-join-in-power-query
The key here is to expand the header table into a table you can merge with. So just like Reza creates a list of dates, you can create a list of lines in a custom column like this:
For the first row, this creates a list of integers from 20 to 160.
Expand that column and then do a standard merge.
As Nathaniel_C points out, in order to add columns from another table, you generally merge the tables and expand the columns you're interested in.
Joining on a range makes this significantly more involved. Radacad has a good article on a very similar problem:
https://radacad.com/dates-between-merge-join-in-power-query
The key here is to expand the header table into a table you can merge with. So just like Reza creates a list of dates, you can create a list of lines in a custom column like this:
For the first row, this creates a list of integers from 20 to 160.
Expand that column and then do a standard merge.
- LobsterLegend4 years agoFrequent Visitor
Thanks! Worked like a charm.