Forum Discussion
Anonymous
4 years agoNot applicable
Lookup using DAX
Hi All, I have two tables: Cargo and Location Detials (Its a lookup/master table) and below are some sample data Cargo Table:
CargoId Origin Destination
1 01 04
2 0...
- 4 years ago
Anonymous you can use the following measures which works with or without any relationship
_origin = CALCULATE ( MAX ( Location[locationName] ), TREATAS ( VALUES ( Cargo[origin] ), Location[locationID] ) ) _destination = CALCULATE ( MAX ( Location[locationName] ), TREATAS ( VALUES ( Cargo[destination] ), Location[locationID] ) )
Jos_Woolley
4 years agoSolution Sage
Hi,
Not sure what you mean when you say "Requirement is to replace the Origin and Destination columns...". You can't overwrite data or remove columns with DAX.
You can add two additional columns to your Cargo table, e.g.:
Origin Location =
LOOKUPVALUE ( Location[LocationName], Location[LocationID], Cargo[Origin] )A similar construction could be used to derive the Destination Location.
Regards