Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
vkisa
Helper II
Helper II

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 monthly table (Temporary Table).

 

I want to get TotalDeposit(MultipleSales) column in my result table.

 

Data Table-Table1

YearMonthCustomeridSalesAmountASalesAmountBDeposit
20241100050010
202411000302010
202411000101015
202411000000
20241100020200
2024110010105
202411001005
202411001000
2024110010010
202411002500
2024110025020
20241100251010

 

Temporary Table (I don't want to create this table, it is just to explain what I want to)

CustomerIDYearMonthMonthlySalesAMonthlySalesBMonthlyDeposit
1000202411105035
10012024101020
100220241151030

 

Table2(my result table)

YearMonthCountofCustomer(MultipleSales)TotalDepositTotalDeposit(MultipleSales)
20241285"35+30=65"

 

Thank you,

Veli

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vkisa ,

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

vzhouwenmsft_0-1724293348435.png

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] )

vzhouwenmsft_1-1724293970442.png

Best Regards,
Wenbin Zhou

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @vkisa ,

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

vzhouwenmsft_0-1724293348435.png

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] )

vzhouwenmsft_1-1724293970442.png

Best Regards,
Wenbin Zhou

Thank you @Anonymous , it worked !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.