Forum Discussion

ekor-sembilan's avatar
ekor-sembilan
Frequent Visitor
3 years ago
Solved

Lookupvalue

Hello,   Hi, I am fairly new to Power BI  and have a problem I cannot solve, I'm facing a problem when trying to find the vehicle data using the following table information. I need a measure that ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi ekor-sembilan ,

    I created a sample pbix file(see the attachment), please check if that is what you want. You can create a calculated column as below in 'Table 1' to get it:

    Vehicle = 
    CALCULATE (
        MAX ( 'Table 2'[Vechicle] ),
        FILTER ( 'Table 2', 'Table 2'[VehicleID] = 'Table 1'[VehicleID] )
    )

    Or you can create a measure as below to get it:

    Measure =
    VAR _selvid =
        SELECTEDVALUE ( 'Table 1'[VehicleID] )
    RETURN
        CALCULATE (
            MAX ( 'Table 2'[Vechicle] ),
            FILTER ( 'Table 2', 'Table 2'[VehicleID] = _selvid )
        )

    Best Regards