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.
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.
- majdkaid2210 years agoHelper V
konstantinos it worked as a treat. many thanks mate!
as you, kcantor and Anonymous said, the more proper way is to have it done in query editor and merge both and have (meaccount) with a country column.
Better to save on some less Dax formulas in the front end.
Many thanks
Majd