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] ) )
CNENFRNL
4 years agoCommunity Champion
To my understanding, LOOKUPVALUE is a legacy from Excel. Here's use a more PBI way to deal with it, which involves inactive relationship and expanded table,
Name Org = CALCULATE(MAX(LOC[LocationName]), CARGO)Name Dest =
CALCULATE(
MAX( LOC[LocationName] ),
CALCULATETABLE(
CARGO,
USERELATIONSHIP ( CARGO[Destination], LOC[LocationID] )
)
)