Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Lookup for multiple columns and multiple values

I have tables like this:

 

Cat

YearCatTypeBudget
2019ANew275
2020BNew200
2021CNew250
2019ARet275
2020BRet200
2021CRet250
2019AUsed275
2020BUsed200
2021CUsed250
   

 

Budget

YearCatBudget
2020A100
2020B200
2020C150
2021A200
2021B225
2021C250
2019A275
2019B300
2019C325

 

I need to get column Budget in first table. I read solutions for lookupvalue formula for multiple columns but it only works for single values, and when I make a merge directly in the transformation data process, it sums the budget in the report view. Please help.

 

Basically is a double lookupvalue by year and cat, that provides multiple values.

  • Anonymous , Create a new column in Cat table

    sumx(filter(Budget, Budget[Year] =Cat[Year] && Budget[cat] =Cat[Cat]),Budget[Budget])

2 Replies

  • Anonymous , Create a new column in Cat table

    sumx(filter(Budget, Budget[Year] =Cat[Year] && Budget[cat] =Cat[Cat]),Budget[Budget])

  • Anonymous 

    if you want to use lookupvalue,you can try this.

    Column = LOOKUPVALUE(budget[Budget],budget[Cat],'cat'[Cat],budget[Year],cat[Year])