Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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".
Hi @LYBridges
Make sure to include a space before and after Risk so it becomes " Risk "
RQDel =
CONCATENATEX (
FILTER (
ADDCOLUMNS (
{ ( 1, "Pre-Risk", "PR" ), ( 2, " Risk ", "R" ), ( 3, "Quality", "Q" ) },
"@Result", IF ( CONTAINSSTRING ( Pipeline[Ops Delegated Services], [Value2] ), [Value3] )
),
NOT ISBLANK ( [@Result] )
),
[@Result],
",",
[Value1], ASC
)
Hi @LYBridges please check this
I spoke too soon. This now returns too few values.
Incorrect returned value -
If the source coulmn has all 3, it is only returning Q.
If the source column has Pre-Risk and Risk, it returns no abbreviation.
Correct return values
If the source column has Risk and Quality, it correctly returns R,Q.
If the source column has Pre-Risk, it correctly returns PR.
If the source column has Risk, it correctly returns R.
I have a multi-select/mulit-choice column that can have any combination of 18 different choices.
For the new column/DAX I'm trying to create, we are only interested in the choices Pre-Risk, Risk and/or Quality.
For each row, we want to know which one or which combination of choices were selected. Due to limited space, we are trimming down to just abbreviations (PR, R, Q).
So the new column will have one or any combination of PR, R, Q displayed based on the multi-select column in the source.
@LYBridges 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?