Forum Discussion

BI2018No's avatar
BI2018No
Frequent Visitor
8 years ago
Solved

SumProduct in measure

Hello technical experts!   I would like to perform a "sumproduct" on two time series in the same datatable. All ID1 should be multiplied by ID2 for all time slots. How can I do this using DAX formu...
  • OwenAuger's avatar
    8 years ago

    Hi there,

     

    With your existing table, a measure like this using SUMX will give you the result you're looking for. I've used variables to make the calculation clearer.

    SumProduct measure = 
    SUMX (
        VALUES ( YourTable[Time] ),
        VAR ValueID1 =
            CALCULATE ( SUM ( YourTable[Value] ), YourTable[ID] = 1 )
        VAR ValueID2 =
            CALCULATE ( SUM ( YourTable[Value] ), YourTable[ID] = 2 )
        RETURN
            ValueID1 * ValueID2
    )

    Regards

    Owen