Forum Discussion

LobsterLegend's avatar
LobsterLegend
Frequent Visitor
4 years ago
Solved

M Language Add New Column

New to PBI here. Attempting to combine data from 2 different tables in Query Editor. From what I've read, this seems a more appropriate place than would DAX. The first Table is Financial Statement Li...
  • AlexisOlson's avatar
    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.