Forum Discussion
LinLinB
3 years agoAdvocate I
DAX SWITCH with multiple combinations, with overlapping/shared values
Hi - I am trying to get the result in "Case" Column. Amount Rating Case 1000 1 1 1000 2 1 1000 3 1 1000 4 2 1000 5 2 1000 3 2 I have tried this: Switch Col...
amitchandak
3 years agoSuper User
LinLinB , In such case it can only be one ,
so change position
SWITCH(
TRUE(),
[Amount] = 1000 && [Rating] in {"4","5","3"}, "Case 2",
[Amount] = 1000 && [Rating] in {"1","2","3"}, "Case 1"
)
LinLinB
3 years agoAdvocate I
Thanks for your response.
Unfortunately, that doesn't work because Rating "3" gets allocated only to Case 1 or Case 2.
Case 1 is on the basis of there being all 3 Ratings true (1-2-3), and Case must have (4-5-3).
At the moment the code just chooses Amount and Rating 1, Amount and Rating 2, Amount and Rating 3 etc.
What would the code for this be?
Thanks