Forum Discussion
Custom Column - Value from other query
- Anonymous6 years agoJust do this:
Table.AddColumn(PrevStep, “NewColumnName”, each OtherTable[ColumnName]{2})
//{2} being the zero-based position of the other table’s item that you want. You could also do
each OtherTable[ColumnName] = “Some Team”, type text).
Add a custom column in Query 1 to just say =Query2, or =#"Query 2" if it has a space in it.
Then expand that one column you want.
Alternatively, if you don't need Query 2 to be a table, right-click on the single value in Query 2, and select drilldown. Power Query will turn that table into a value.
Then in Query 1, add a custom column that just says =Query2, or =#"Query 2" and just that value will be there.
- MC46 years agoFrequent Visitor
Thanks edhans for responding!
I have attempted your suggestion - however the custom column has populated with "Table". I'm not sure if this is because Query 2 has multiple rows?
With that - I would like to be able to take a value from a specific row in Query 2 to populate the Custom Column in Query 1 - say the value from the 3rd row in Query 2. Is this possible?
Thanks again.
- v-frfei-msft6 years agoCommunity Support
Hi MC4 ,
Please tyr to merge table. If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive for Business and share the link here.
- edhans6 years agoCommunity Champion
See links below for posting some data. I cannot figure out exactly what is going on with the descriptions you are giving.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum- MC46 years agoFrequent Visitor
Apologies.
Here is a link to a sample file on Dropbox;
https://www.dropbox.com/s/zahfgwhw0h8t909/Sample%20Power%20BI.pbix?dl=0
In Table 2 there is a Custom Column called "Club Name" which is currently populated with just text ("Club 3").
I would like the value in the "Club Name" column to be linked to Table 1, row 3 via a formula instead.
Hope that clarifies.
Thanks again.