//Metadata: //Programming language: Power Query M //Natural language: German //Output: replaces column content //Explanation: //Cleans the content of a cluster column customer segment "Kundensegment", based on the name and company type //Use case could be for unprecise customer data provided in an online store //How to use: //Copy the code into an "replace step" Code: #"Replaced Value" = Table.ReplaceValue( #"PLACEHOLDER_previous_step", each [Kundensegment], each if List.AnyTrue({Text.Contains([Name], "mbH"), Text.Contains([Name], "OHG"), Text.Contains([Name], "UG"), Text.Contains([Name], "AG"), Text.Contains([Name], "e.K."), Text.Contains([Name], "enossenschaft"), Text.Contains([Name], "üro"), Text.Contains([Name], ".de"), Text.Contains([Name], "LLC"), Text.Contains([Name], "ltd"), Text.Contains([Name], "GbR"), Text.Contains([Name], "Co."), Text.Contains([Name], "eG")}) then "Firma" else if [Kundensegment] = "firma" then "Firma" else if [Kundensegment] = "herr" or [Kundensegment] = "frau" then "Privatperson" else "Sonstige", Replacer.ReplaceText, {"Kundensegment"} )