Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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, chocolate chips, and caramel syrup." I have a new column called Toppings Used where I want to list the toppings that were contained in the string of text from Customer Order Description. For example for the previously mentioned order description have "rainbow sprinkles, chocolate chips, caramel syrup" as a data cell with toppings separated by a comma and a space.
Currently I have the DAX function:
Toppings Used = Switch (TRUE(), Containsstring('Ice Cream Order Table'[Customer Order Description], "chocolate chip"), "chocolate chip", Containsstring('Ice Cream Order Table'[Customer Order Description], "fudge"), "fudge sauce", ...)
However, this only gives me one of the toppings. How can I change this code to output multiple values? Thanks in advance.
Solved! Go to Solution.
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
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
This solved my problem, thank you!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |