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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
giuliapiazza94
Helper IV
Helper IV

Merge query with dax

Hi, 

I have two tables like 

1giuliapiazza94_0-1637163287340.png  

2giuliapiazza94_1-1637163295663.png

 

I'd like to have the values "Farm" in the first table using DAX.

How can I to do?

 

Thank you all 🙂

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @giuliapiazza94 

 

try this to add a new column in table 1:

Farm = LOOKUPVALUE('Table 2'[Farm],'Table 2'[customer],'Table 1'[Customer])
 
 
output:
 
VahidDM_0-1637221961353.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/


 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @giuliapiazza94 ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thanks in advance for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi @giuliapiazza94 

 

try this to add a new column in table 1:

Farm = LOOKUPVALUE('Table 2'[Farm],'Table 2'[customer],'Table 1'[Customer])
 
 
output:
 
VahidDM_0-1637221961353.png

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/


 

smpa01
Super User
Super User

@giuliapiazza94  you can create relationship between t1 and t2 through Customer column and then you can create a calculated column in t1 like following

Farm from t2 = RELATED(t2[Farm])
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

I've tried but i've this error 

giuliapiazza94_0-1637221520051.png

but there is a relationship 1:m between two tables

Greg_Deckler
Community Champion
Community Champion

@giuliapiazza94 In your first query, add a Merge Query step in Power Query Editor to merge the second table on the customer columns.

Greg_Deckler_0-1637164112694.png

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I can't use Power Query because I haven't direct access to customer's database.

I need to do this using only DAX

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.