Forum Discussion
Lookup Value two tables
- 10 years ago
majdkaid22 kcantor Merge queries is easiest way but probably will return multiple rows ( since we matching values from many to one ) so then remove duplicates on ID and good to go.
You can try with DAX also in case you have a column in meAccountHistory , like date or transaction ID that defines the latest record.
Create a calculated column :
BringCountry = LASTNONBLANK(meAccountHistory[IsoCountry];MAX(meAccountHistory[Date])) or LASTNONBLANK(meAccountHistory[IsoCountry];MAX(meAccountHistory[TransactionID]))
This way you avoid returning multiple values.
Be careful though that it will bring the latest IsoCountry so if an account change country it will show him as the latest country. Of cource if you use filter from meAccount table.
Hope that helps.
Create new column:
ISOCountryName = lookup('meAccount'[CountryColumn] , 'meAccount'[AccountID] , 'meAccountHistory'[AccountID )
I can't seem to find the country in your meAccount table though. If you have it than the above should work
Edit: You should also take the summary off from AccountID in your table as you probably won't be doing any sums with ID's :)
Default summarization = Do Not Summarize
- majdkaid2210 years agoHelper V
Anonymous thanks mate
The country is in the (meaccounthistory) table, and I want to have it added to (meaccount)
How will that work?
- Anonymous10 years agoNot applicable
ISOCountryName 2 = lookup('meAccountHistory'[ISOCountryName] , 'meAccountHistory'[AccountID] , 'meAccount'[AccountID )
- majdkaid2210 years agoHelper V
My challenge here that hiaccounthistory has mutiple records for the same AccountID.
How can I trigger this?