Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
LobsterLegend
Frequent Visitor

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 Lines and the second is Financial Statemeant Headers (a super-category for lines). Very rookie question: when attempting to add a new column, I cannot reference a column from another table. It could be a simple syntax issue I am missing.

 

These are the Tables in reference.

LobsterLegend_0-1653676428853.png

 

Within GL FS Lines, I use Custom Column and attempt to use the Table.Column function to begin my formula. I can reference the other Table -- GL FS Headings -- just fine. But when I attempt to reference the column 'Header' from that Table, you can see that I am not given that option. Rather, I am given options for the current Table (GL FS Lines). Why can I not see any columns from the Table GL FS Headings?

LobsterLegend_1-1653676508930.png

 

Sampling of data in GL FS Lines:

LobsterLegend_2-1653676625066.png

 

Sampling of Data in GL FS Headings: (there's 2 columns for FS Line further to the right. It's a range so I'll have to use an additional function to account for that)

LobsterLegend_3-1653676661938.png

LobsterLegend_4-1653676711986.png

 

I appreciate your input.

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

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:

AlexisOlson_0-1653776142127.png

For the first row, this creates a list of integers from 20 to 160.

 

Expand that column and then do a standard merge.

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

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:

AlexisOlson_0-1653776142127.png

For the first row, this creates a list of integers from 20 to 160.

 

Expand that column and then do a standard merge.

Thanks! Worked like a charm.

Nathaniel_C
Community Champion
Community Champion

Hi @LobsterLegend ,
Merge the two tables, and during that process only select the one column that you wish to add to your base table.

 


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel

Nathaniel_C_0-1653679377941.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




HenriqueReis
Resolver I
Resolver I

Hi,

 

Please, try to do a relation between those tables here, out of query:

HenriqueReis_0-1653679353773.png

 

Or try to merge those columns here, inside Power Query:

HenriqueReis_1-1653679419643.png

 

Regards!

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors