cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dub Frequent Visitor
Frequent Visitor

Dynamicaly pull data from other tables based on a field value


I have a table Combine and tables Table 1, Table 2, Table 3, ... Table 10.


Each of the tables Table 1, ... Table 10 has one row with multiple columns. Lets say on of the columns is Table1[Id] and the other is Table1[Number].


The table Combine has a column Combine[Id], which is a list of Ids from Table1,...Table 10.


Now i need to create a new column Combine[Values] which will dynamicaly pull the data from Table 1[Number]...Table 10[Number] into the column Combine[Values] based on the matching Ids.



F.ex.


If,


Table1[Id]=1 and Table1[Number]=111

Table2[Id]=2 and Table2[Number]=222


Table Combine should look like:


ID  Value

1    111

2    222


Can anyone help, please?

Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Dynamicaly pull data from other tables based on a field value

Hi @dub,

 

After loading all these tables (Combine, Table1, Table2,...Table10) into Power BI desktop, you should first Append tables from Table1 to Table10 in Query Editor mode. Suppose the new appended table is called Table11, then, in report view mode, you can use LookUpValue function to  create a new calculated column Combine[Values] in Combine Table.

 

Values=LOOKUPVALUE(Table11[Number], Table11[Id], Combine[Id])

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft Super Contributor
Super Contributor

Re: Dynamicaly pull data from other tables based on a field value

Hi @dub,

 

After loading all these tables (Combine, Table1, Table2,...Table10) into Power BI desktop, you should first Append tables from Table1 to Table10 in Query Editor mode. Suppose the new appended table is called Table11, then, in report view mode, you can use LookUpValue function to  create a new calculated column Combine[Values] in Combine Table.

 

Values=LOOKUPVALUE(Table11[Number], Table11[Id], Combine[Id])

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

dub Frequent Visitor
Frequent Visitor

Re: Dynamicaly pull data from other tables based on a field value

Thanks. It did the work 🙂

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 168 members 2,025 guests
Please welcome our newest community members: