I have a column in Power Bi table that contains multiple values and I want to create a new column that keeps the unique values only from the original one.
Example:
if the multiple value is "Springfield, Springfield, Pueblo West", the new column should show "Springfield, Pueblo West".
if the multiple value is "Springfield, Springfield, Springfield", the new column should show "Springfield".
Is there a way to create a calculated column that solves this?
This is the mage of the column and wanted result in red colour.
You can find sample data in PBI format at the next GDrive LINK:
Click transform data from the ribbon. When in Power Query, click Add Column -> Custom Column. Paste in the following code:
Text.Combine( List.Distinct( List.Transform( Text.Split([City],","), each Text.Trim(_))),",")