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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.