Forum Discussion
Multiple Case Statement in a measure
- 5 years ago
Anonymous , You can try like this. But You can not simply use Table 2 in table 1. That will depend on relation .
sumX(Table1 , Switch(True(), Table1[field1] in {10, 12, 13, 33, 35, 37, 39 } , 0 ,
Table1[field1] in {71, 75} , Table1[amt] ,
Table1[name] = "AB" , Table1[amt] , 0
)or
sumX(Table1 , Switch(True(), Table1[field1] in {10, 12, 13, 33, 35, 37, 39 } , 0 ,
Table1[field1] in {71, 75} , Table1[amt] ,
related(Table2[name]) = "AB" , related(Table2[amt]) , 0
)Refer to my Video on Switch : https://www.youtube.com/watch?v=gelJWktlR80&pbjreload=101
Anonymous , You can try like this. But You can not simply use Table 2 in table 1. That will depend on relation .
sumX(Table1 , Switch(True(), Table1[field1] in {10, 12, 13, 33, 35, 37, 39 } , 0 ,
Table1[field1] in {71, 75} , Table1[amt] ,
Table1[name] = "AB" , Table1[amt] , 0
)
or
sumX(Table1 , Switch(True(), Table1[field1] in {10, 12, 13, 33, 35, 37, 39 } , 0 ,
Table1[field1] in {71, 75} , Table1[amt] ,
related(Table2[name]) = "AB" , related(Table2[amt]) , 0
)
Refer to my Video on Switch : https://www.youtube.com/watch?v=gelJWktlR80&pbjreload=101