Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello there,
I am looking for help in Dax, I need to perform aggregation(sum) based on the product with an explicit filter condition.
Sample Data:
| Product | Value | Trendy |
| Apple | 2000 | Yes |
| Apple | 3000 | No |
| Orange | 1000 | Yes |
| Orange | 2000 | No |
| Mango | 1000 | Yes |
| Mango | 1000 | No |
eg: for apple , I should sum where trendy="Yes",
for orange, I should show sum where trendy="No",
else just sum
Expected Result:
| Product | Sales |
| Apple | 2000 |
| Orange | 2000 |
| Mango | 2000 |
I have tried something like this but not getting the expected result.
Solved! Go to Solution.
@Anonymous , Try like
Measure = sumx(Sheet1,SWITCH(TRUE(),Sheet1[Product]="Apple" && Sheet1[Trendy]="Yes", Sheet1[Value],
Sheet1[Product]="Orange" && Sheet1[Trendy]="No",Sheet1[Value],
Sheet1[Product] in {"Orange","Apple"} , blank(),
Sheet1[Value])
)
@Anonymous , Try like
Measure = sumx(Sheet1,SWITCH(TRUE(),Sheet1[Product]="Apple" && Sheet1[Trendy]="Yes", Sheet1[Value],
Sheet1[Product]="Orange" && Sheet1[Trendy]="No",Sheet1[Value],
Sheet1[Product] in {"Orange","Apple"} , blank(),
Sheet1[Value])
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 124 | |
| 107 | |
| 80 | |
| 69 | |
| 67 |