Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to look for the email in Table 2 and add it as a calculated column in Table 1. There isn't a direct relationship between the 2 tables. They're related via a table which resides between them. I can't use the relationship to simply add the email field.
Table 1 -
id | Campaign name | ownername |
1 | Campaign 1 | firstname.lastname |
2 | Campaign 2 | firstname.lastname |
Table 2 -
id | name | |
1 | firstname.lastname | name@gmail.com |
2 | firstname.lastname | name2@gmail.com |
I am looking to add email from table 2 to table 1. I'm using the following DAX to add a calculated column to Table1 -->
campaign email = LOOKUPVALUE('Table2'[email], 'Table2'[name], 'Table1'[ownername])
This appears to work, however, I'm not getting values for each record in Table 1.
Hope this makes sense - if there is a different DAX function, please let me know.
Thanks in advance for your help!
Jim
Solved! Go to Solution.
Hi @Anonymous ,
If it doesn’t match in table 1, what value do you want to show, a blank? Why don’t you use ID?
You can create a column to find the email based on id.
campaign email = LOOKUPVALUE('Table 2'[email], 'Table 2'[id], 'Table 1'[id])
campaign email 2 = CALCULATE(MAX('Table 2'[email]),FILTER('Table 2','Table 2'[id]='Table 1'[id]))
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
I have a similar issue. The lookup function appears to be working (there is no error), but all the results are blank. In my case, I cannot use an ID, because there are too many options and some names appear in one of the tables more than once.
What i'd like for PowerBI to do, using this example, is for the email to show up next to the ownername, each time it is appears in table 1.
Any ideas?
Thank you!
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?
Could you please provide more details or expected result about it If it doesn't meet your requirement?
If you've fixed the issue on your own please kindly share your solution. If the above posts help, please kindly mark it as a solution to help others find it more quickly.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
If it doesn’t match in table 1, what value do you want to show, a blank? Why don’t you use ID?
You can create a column to find the email based on id.
campaign email = LOOKUPVALUE('Table 2'[email], 'Table 2'[id], 'Table 1'[id])
campaign email 2 = CALCULATE(MAX('Table 2'[email]),FILTER('Table 2','Table 2'[id]='Table 1'[id]))
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |