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","")
tamerj1
Community Champion
1 year agoDepending on how Risk is written in the source. It might be " Risk" or " Risk,". This is something you can find out by looking at some values of the source column.
LYBridges
1 year agoFrequent Visitor
It shows up as " Risk,".
I'll try that.
Thanks so much. Love the approach.