Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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])
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
79 | |
73 | |
56 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |