Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX Function to Output Multiple Comma-Separated Values

I have an Ice Cream Order Table with one column being Customer Order Description. An example of a data cell from that column is "The customer ordered a small vanilla ice cream with rainbow sprinkles,...
  • Jos_Woolley's avatar
    4 years ago

    Hi,

    Assuming you have another table named 'Toppings' which comprises a single column (named 'Topping') of all possible toppings, this Calculated Column in the Ice Cream Order Table:

     

    Toppings Used = 
    VAR ThisOrder = 'Ice Cream Order Table'[Customer Order Description]
    RETURN
        CONCATENATEX(
            FILTER( Toppings, SEARCH( Toppings[Topping], ThisOrder,, 0 ) ),
            Toppings[Topping],
            ", "
        )

     

    Regards