Forum Discussion
LYBridges
1 year agoFrequent Visitor
DAX returning 2 values when only 1 is selected
This is basically a DAX to abbreviate words to 1 or 2 letters and then list them and eliminate trailing commas. If only Pre-Risk is selected, it keeps returning "PR,R". It should just return "PR". ...
- 1 year ago
This is the solution that finally worked -
RQDel =SWITCH(TRUE(),CONTAINSSTRING('Pipeline'[Delegated Services], "Pre-Risk") && CONTAINSSTRING('Pipeline'[Delegated Services], ", Risk") && CONTAINSSTRING('Pipeline'[Delegated Services], ", Quality"), "PR, R, Q",CONTAINSSTRING('Pipeline'[Delegated Services], "Pre-Risk") && CONTAINSSTRING('Pipeline'[Delegated Services], ", Quality"), "PR, Q",CONTAINSSTRING('Pipeline'[Delegated Services], "Pre-Risk") && CONTAINSSTRING('Pipeline'[Delegated Services], ", Risk"), "PR, R",CONTAINSSTRING('Pipeline'[Delegated Services], "Risk") && CONTAINSSTRING('Pipeline'[Delegated Services], ", Quality"), "R, Q",CONTAINSSTRING('Pipeline'[Delegated Services], "Pre-Risk"), "PR",CONTAINSSTRING('Pipeline'[Delegated Services], "Risk"), "R",CONTAINSSTRING('Pipeline'[Delegated Services], "Quality"), "Q","")
Greg_Deckler
Community Champion
1 year agoLYBridges Well, yeah, because "Pre-Risk" also contains the word "Risk" so that's the logical outcome of what you have coded. The real question, what do you actually expect the output to be and can you provide sample data?