Forum Discussion

dgranddemars's avatar
dgranddemars
Frequent Visitor
3 years ago
Solved

Calculated column with sum and filters

Hello   I don't manage to define the formula to crete the following calculated column :   I have 3 tables Invoice InvoiceNum Amount Invoice Date 123 34 01/01/2023 124 50 05/01/...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  dgranddemars ,

     

    Here are the steps you can follow:

    1. Create calculated column.

    Date_Invoice =
    MAXX(
        FILTER(ALL(Invoice),
        'Invoice'[InvoiceNum]=EARLIER('Events'[InvoiceNum])),'Invoice'[Invoice Date])
    Sum_Incomes =
    SUMX(
        FILTER(ALL(Incomes),
        'Incomes'[Date]>=EARLIER('Events'[Date_Invoice])&&'Incomes'[Date]<=EARLIER('Events'[Date])
        &&'Incomes'[InvoiceNum]=EARLIER('Events'[InvoiceNum])),[Amount])

    2. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly