Forum Discussion
Merge query with dax
Hi,
I have two tables like
1
2
I'd like to have the values "Farm" in the first table using DAX.
How can I to do?
Thank you all 🙂
try this to add a new column in table 1:
Farm = LOOKUPVALUE('Table 2'[Farm],'Table 2'[customer],'Table 1'[Customer])output: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/
6 Replies
- Greg_Deckler
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.
- giuliapiazza94
Helper IV
I can't use Power Query because I haven't direct access to customer's database.
I need to do this using only DAX
- smpa01
Community Champion
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])- giuliapiazza94
Helper IV
I've tried but i've this error
but there is a relationship 1:m between two tables
- VahidDM
Super User
try this to add a new column in table 1:
Farm = LOOKUPVALUE('Table 2'[Farm],'Table 2'[customer],'Table 1'[Customer])output: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/ - AnonymousNot 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 _ CaitlynIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.