cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Power Query - How to resolve variable/column scope, or how to reference column inside a table.

 

In Power BI, I have a table that has a column of tables. See screenshot below:

 

 Pic1.png

 

Inside of the column called ThirdTable, each has a table that has the final information I’d like to grab. Specifically, the row with the value “Title”. See below for a screenshot of that table:

 

 Pic2.png

 

 

The simple query I’ve written is as follows:

 

let

finalRow = Table.SelectRows([ThirdTable], [Name] = "Title")

in

finalRow

 

 

The issue is that Power Query ends up searching for the [Name] column on the higher level table, and it ends up failing because there is no [Name] column on the higher level. I’d really just like to be able to reference the [Name] column from [ThirdTable]. I’d like to do something as simple as [ThirdTable].[Name] or something like that.

1 ACCEPTED SOLUTION
Community Support
Community Support

@benn,

 

You may add step below.

= Table.TransformColumns(#"Added Custom", {"ThirdTable", each Table.SelectRows(_, each ([Name] = "Title"))})
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support
Community Support

@benn,

 

You may add step below.

= Table.TransformColumns(#"Added Custom", {"ThirdTable", each Table.SelectRows(_, each ([Name] = "Title"))})
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors