Search code examples
reporting-servicesssrs-2012

SSRS Lookup Based on Multiple Conditions


I have a dataset (Volume) looks like this:

enter image description here

In my report, what I want to get is this:

enter image description here

The Lookup expression: =Lookup (Fields!Id.Value, Fields!Id.Value, Fields!Volume.Value,"Volume") can only lookup on ID. Is there any way I can do lookup on ID first, and then lookup on Sub_Group to get the correct Volume? Thank you.


Solution

  • You can Lookup using multiple fields if you concatenate all the necessary fields in the first and second Lookup parameter.

    =Lookup(Fields!ID.Value & Fields!SUB_GROUP.Value, Fields!ID.Value & Fields!SUB_GROUP.Value, Fields!VOLUME.Value, "Volume")
    

    Alternatively, you can concatenate all the necessary fields in your dataset and use that for your Lookup.