Forum Discussion

tdoth1995's avatar
tdoth1995
Regular Visitor
3 years ago
Solved

Using LOOKUPVALUE with multiple conditions, returns one value if only one condition met

Not sure of the best way to describe the problem or even how to approach solving this but let me try my best.    I'm using LOOKUPVALUE to pull a value based on two columns: [Defect] and [Location] ...
  • jgeddes's avatar
    3 years ago

    You can try to add a conditional 'location' variable in your calculated column.
    Something along the lines of...

    Average = 
    var _location =
    IF(
        ISBLANK(
            LOOKUPVALUE('Table A'[Location], 'Table A'[Name], 'Table B'[Name], 'Table A'[Location], 'Table B'[Location])
        ),
        "Other",
        [Location]
    )
    Return
    LOOKUPVALUE(
        'Table A'[Avg],
        'Table A'[Name], 'Table B'[Name],
        'Table A'[Location], _location
    )

    Basically you are performing the lookup twice. The first time to see if the location returns a blank. The second time returns the rework time using 'Other' if needed.