Forum Discussion
Using Data from One Table in Another Table
- 10 years ago
In this scenario, you should have linked column between those two tables. Then you can go to Query Editor and use "Merge Queries" to combine the tables together. See: Shape and combine data in Power BI Desktop
Another way is using DAX method. If you have built the relationships between these two tables, you can use RELATED() function to JOIN tables. Without relationship built, you can also use LOOKUPVALUE() to lookup that columns you need. For more information, please see: From SQL to DAX: Joining Tables.
Regards,
Hi, I was log looking for similar answer, so I asked also chat gpt, so to gether we arrived to solution which works with provacy error, which you do disable in file -> privacy -> disable.
let
// Connect to your data source and retrieve the names
Source = ... // Your data source query or source data
// Select the column containing names
NamesColumn = Source[Name],
// Convert the column to a list
NamesList = List.Buffer(NamesColumn),
// Create a text list with single quotes and commas
NamesText = "'" & Text.Combine(NamesList, "','") & "'",
// Connect to your data source again for the second query
Source2 = ... // Your data source query or source data with WHERE clause using NamesText
in
Source2
SELECT ... FROM ... ..WHERE name IN (" &NamesText &")"])