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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
marisap
Regular Visitor

Using Data from One Table in Another Table

Hi There, 

 

I want to copy data from an imported Database Table and create a new table that includes the data from the imported table as well as additional columns that I would like to create my self. 

 

For example: 


I have an imported database table that includes numbers that are related to certain WAN Interfaces. However I want to create a table that includes the numbers but has them listed with more user friendly names as opposed to the long name that is included in the database. I want these numbers to update when I press refress and be related to the original Database Table so that they update. 

 

How can I do this? 

 

Thanks!

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@marisap

 

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,

View solution in original post

6 REPLIES 6
JanisA0064
New Member

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 &")"])

v-sihou-msft
Employee
Employee

@marisap

 

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,

ankitpatira
Community Champion
Community Champion

@marisap You can do this by going to query editor in power bi desktop, right click your original table query and click Reference. Then add conditional columns to new created queries and when you hit refresh your original table will be refreshed and so will be the table with reference query.

THANK YOU

Thank you!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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