Forum Discussion

ojferreira's avatar
ojferreira
Frequent Visitor
4 years ago
Solved

Calculate and filter using multiple tables

Hello,   I have two data tables, one (I'll call it table 1) for occurrences by date, product, production line, and how long it lasted. And another one with the campaign with start and end date, lin...
  • Ashish_Mathur's avatar
    Ashish_Mathur
    4 years ago

    This calculated column formula in the Campaigns table works

    =CALCULATE(SUM(Occurences[Duration]),FILTER(Occurences,Occurences[Line]=EARLIER(Campaign[Line])&&Occurences[Product]=EARLIER(Campaign[Product])&&Occurences[Date]>=EARLIER(Campaign[Start date])&&Occurences[Date]<=EARLIER(Campaign[End Date])))

    Hope this helps.