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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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