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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
amalekshahi
Frequent Visitor

Multi-column relationship in Direct Query

Hi,

 

I have two tables in Redshift that I want to connect to using Direct Query, model the data and use it in Power BI. The tables are:

Program: 

   AccountID int

   ProgramID int

   ProgramName varchar (100)

 

Events

   AccountID int

   ProgramID int

   EventDate TimeStamp

   Description varchar (500)

 

The tables need to be joined on AccountID and ProgramID. I tried using "Merge Queries" to create a relationship on two columns but Power BI gives me error as this feature isn't supported in Direct Query mode. I saw other suggestions about adding calculated columns to each table but this will have a performance overhead as both columns are integer, need to be converted to string and then concatenated. Is there any other option to create multi-column relationship in Direct Query? 

 

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @amalekshahi,

 

From my opinion, the better choice is to add a calculated column "AccountID" & "ProgramID" to each table. Then, you can establish relationship between this new column. Why do you mind formatting this new column with string type? This is just a related column, but you can still make calculation based on original numeric fileds.

 

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.

Hi @v-yulgu-msft

I am just concerned about the performance in Power BI, converting int to string and then concatenating them to create relationship seems to be a lot of overhead.

Hi @amalekshahi,

 

What is your data source type? If using SQL Server Database, another way is to merge table via SQL query. If using Analysis Service, you can merge tables via MDX.

1.PNG

 

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors