Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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
Year | Month | Customerid | SalesAmountA | SalesAmountB | Deposit |
2024 | 1 | 1000 | 50 | 0 | 10 |
2024 | 1 | 1000 | 30 | 20 | 10 |
2024 | 1 | 1000 | 10 | 10 | 15 |
2024 | 1 | 1000 | 0 | 0 | 0 |
2024 | 1 | 1000 | 20 | 20 | 0 |
2024 | 1 | 1001 | 0 | 10 | 5 |
2024 | 1 | 1001 | 0 | 0 | 5 |
2024 | 1 | 1001 | 0 | 0 | 0 |
2024 | 1 | 1001 | 0 | 0 | 10 |
2024 | 1 | 1002 | 5 | 0 | 0 |
2024 | 1 | 1002 | 5 | 0 | 20 |
2024 | 1 | 1002 | 5 | 10 | 10 |
Temporary Table (I don't want to create this table, it is just to explain what I want to)
CustomerID | Year | Month | MonthlySalesA | MonthlySalesB | MonthlyDeposit |
1000 | 2024 | 1 | 110 | 50 | 35 |
1001 | 2024 | 1 | 0 | 10 | 20 |
1002 | 2024 | 1 | 15 | 10 | 30 |
Table2(my result table)
Year | Month | CountofCustomer(MultipleSales) | TotalDeposit | TotalDeposit(MultipleSales) |
2024 | 1 | 2 | 85 | "35+30=65" |
Thank you,
Veli
Solved! Go to Solution.
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
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
Thank you @Anonymous , it worked !
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |