Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • smpa01's avatar
    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] )
    )