Forum Discussion

manoplaeli's avatar
manoplaeli
Icon for Helper II rankHelper II
4 years ago
Solved

lookup Value for multiple column with range

Hi all, need your help.

What I wanted to do is quite simple which is to add description in another table base on the country name and the amount that fit the proper threshold. I have two tables as below and want to add description in the red box.

 

       

 

Thank you in advance,

  • Try to create a new purchasing amount column:

    new_purchasing amount= CALCULATE(SUM('Table'[purchasing amount]),FILTER('Table',EARLIER('Table'[purchasing order number])='Table'[purchasing order number]))

    Replace purchasing amount column with the new column in the previous formula.

4 Replies

  • manoplaeli , a new column in table2

     

    Table2 = maxx(filter(Table1, Table2[Purchase Amount] >= Table1[Threshhold from] && Table2[Purchase Amount] <= Table1[Threshhold to] ) , Table1[Description])

     

     

    • manoplaeli's avatar
      manoplaeli
      Icon for Helper II rankHelper II

      amitchandak one more question. I just realise that the purchasing amount need to be grouped in one Purchasing Order Number before evaluating the threshold level. 

       

      The coding above is also not filtering the country.

       

      Many thanks,

      • V-lianl-msft's avatar
        V-lianl-msft
        Icon for Community Support rankCommunity Support

        Try to create a new purchasing amount column:

        new_purchasing amount= CALCULATE(SUM('Table'[purchasing amount]),FILTER('Table',EARLIER('Table'[purchasing order number])='Table'[purchasing order number]))

        Replace purchasing amount column with the new column in the previous formula.