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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Help working with linked data from two SQL databases in Direct Query mode

I am working from 2 SQL server sources using DirectQuery. In SQL server A, Event_ProductID is an integer, and in SQL Server B, "productID" is a string but it should be a matching field between the two and it did allow me to make a 1 (product table) to many (event table) relationship, but it's not letting me create visuals with both of these tables contributing columns. 

 

The 'Product' table comes from SQL server A and has the following columns:

Cost, Name, productID

 

The 'Event' table comes from SQL server B and has the following columns:

EventOwner, Event_ProductID, Event_SessionName, Event_Location

 

I was thinking i could maybe make a new table with productID, name, EventOwner and Event_SessionName and use that for my visualisations but the RELATED function doesn't seem to be working and I'm a bit stuck at this point.

 

Any advice on how to make a new table referencing both these tables and converting productID to an integer on the fly?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

What I was really looking for was the function LOOKUPVALUE. All sorted now, thanks!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

What I was really looking for was the function LOOKUPVALUE. All sorted now, thanks!

Anonymous
Not applicable

@Anonymous 
For many to many relationship, only RELATEDTABLE function (DAX) - DAX | Microsoft Docs function. If you want to use RELATED function (DAX) - DAX | Microsoft Docs, you may create a mid table using distinct([column]), then link both tables to the mid table with 1 to many relationship.

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , if the product ID is not unique in one of the tables you will get M-M to join. You can have a table in import mode (composite mode) and use that. Create a product table in import mode and use that with both databases.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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