Forum Discussion

yaya1974's avatar
yaya1974
Icon for Helper III rankHelper III
2 years ago
Solved

Looking up values from another table with multiple filters

Hi.    Cust CL8-OH Share = CALCULATE(FIRSTNONBLANK(TruckBuildShare[Class 8 - OH Cust],1),FILTER(TruckBuildShare,TruckBuildShare[Customer]=BumperOEM[Customer]),FILTER(TruckBuildShare,TruckBuildShare...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi yaya1974 ,

     

    What does "bring back all values" mean? Could you please provide an example?

     

    If the value in the TruckBuildShare table is different for each month, and you want to use Cust CL8-OH Share to get the value for each month. Then you should modify your filter so that the filter is accurate to month.

    Cust CL8-OH Share = CALCULATE(FIRSTNONBLANK(TruckBuildShare[Class 8 - OH Cust],1),TruckBuildShare[Customer]=BumperOEM[Customer],TruckBuildShare[Year]=BumperOEM[Year],TruckBuildShare[Month]=BumperOEM[Month])

     

    If you want to get the sum of each month instead of just returning the first value of each month, you can use SUM.

    Cust CL8-OH Share = CALCULATE(SUM(TruckBuildShare[Class 8 - OH Cust]),TruckBuildShare[Customer]=BumperOEM[Customer],TruckBuildShare[Year]=BumperOEM[Year],TruckBuildShare[Month]=BumperOEM[Month])

     

     

    Best regards,

    Mengmeng Li