Forum Discussion

NickProp28's avatar
NickProp28
Icon for Post Partisan rankPost Partisan
4 years ago
Solved

LOOKUPVALUE

Dear Community,    As I have two tables, DB and ActualProfit, I would like to look up the sum of DB table based on month and year into ActualProfit table, but Do not replace the numbers in Actual P...
  • PC2790's avatar
    4 years ago

    Hey NickProp28 ,

     

    You can try something like this:

    lookup = if(ActualProfit[Profit]<> BLANK(),ActualProfit[Profit],CALCULATE(SUM('DB'[Profit]),FILTER('DB','DB'[Month]= ActualProfit[Month] && 'DB'[Year] = ActualProfit[Year] )))

    This will create a new column taking values from the Profit if they are already there and if not, it will do the calculation and fill the result. The outcome will be as:

    Will this solve the purpose?