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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JustyceW
Frequent Visitor

How to reference another table in Query Editor (M)

Hello,

 

I am attempting to reference a table for a custom column in the Query Editor mode of Power BI desktop.

 

The formula will be similar to the solution found in the following link

 

"= List.Average(Table.Column(Table2,[EggName]&"NO2"))"

 

What is the syntax for Table2?

 

For example, columns are referenced as [Column1] in M but what is the reference for other tables?

 

Looking forward to your responses.

 

Have a great day!

 

 

1 ACCEPTED SOLUTION
MarcelBeug
Community Champion
Community Champion

Just the name of the table, which is equal to the name of the query from which the table is the result.

 

If the name of the query (table) contains spaces or other special characters, the name must be included in #"....",
e.g. #"Table name".

 

 

Specializing in Power Query Formula Language (M)

View solution in original post

5 REPLIES 5
MarcelBeug
Community Champion
Community Champion

Just the name of the table, which is equal to the name of the query from which the table is the result.

 

If the name of the query (table) contains spaces or other special characters, the name must be included in #"....",
e.g. #"Table name".

 

 

Specializing in Power Query Formula Language (M)

Hello,

 

It looks like that works! 

 

The problem now is I am getting an error: 

 

"Expression.Error: A cyclic reference was encountered during evaluation"

 

Here is my formula: = List.Count(List.FindText([Initiative],Table.Column(#"Master - Milestones",[IdeaID])))

 

For context, I am trying to count the number of milestones for each initiative. The initiative is the key for my current table and the foriegn key in the "Master - Milestones" table.

 

I would be grateful if you could help me resolve this error and achieve my desired output. 

 

Best,

 

Justyce

It's hard to say. Referencing a column in another table is not a problem as such.

The issue must be related to your entire query structure, e.g. 2 tables referencing each other.

Specializing in Power Query Formula Language (M)

Thank you for your replies:

 

Based on your experience, do you think this error is caused by a join between the Initiative and Milestone tables or because they are linked like a database?

 

Best,

 

Justyce

You're welcome.

 

I have no answer to your last question: I've studied Power Query Formula Language quite thoroughly, but my experience with Power Query and databases is close to zero.

 

 

Specializing in Power Query Formula Language (M)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric Community.