Forum Discussion

vkisa's avatar
vkisa
Icon for Helper II rankHelper II
2 years ago
Solved

Measure for Monthly Sum with Filter

Hi, I need some help to get measure that calculates the total deposit for specific customers that had accomplished sales both product A and B (green cells). I don't want to create a new calculated ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi vkisa ,

    Regarding your question, Is it because the sales volume is 0 that excludes the calculation of '1001'?

    Try this.

    MEASURE =
    VAR _table =
        ADDCOLUMNS (
            SUMMARIZE (
                'Table1',
                [Customerid],
                "SalesA", SUM ( Table1[SalesAmountA] ),
                "SalesB", SUM ( Table1[SalesAmountB] ),
                "Deposit", SUM ( Table1[Deposit] )
            ),
            "isAccomplish",
                IF ( [SalesA] <> 0 && [SalesB] <> 0, TRUE (), FALSE () )
        )
    RETURN
        SUMX ( FILTER ( _table, [isAccomplish] = TRUE () ), [Deposit] )

    Best Regards,
    Wenbin Zhou