Power Query - Multiply by % if Descriptions column contains certain phrases

Occasional Visitor

Hi 

 

I am looking for a calc that multiplies my cost column by 3% if my description column contains one of the below phrases, if it does not then it does not multiply.

 

 Labour
 Subcontract
 Plant
 Materials

 

Adean7_0-1657270223955.png

any help much appreciated

 

2 Replies

@Adean7 

You can try the attached file.

power query.JPG

@Adean7 

As variant

let
    Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
    words = {"plant", "materials", "subcontract", "labour" },
    adjustCost = Table.AddColumn(
        Source,
        "new cost",
        each
            if List.ContainsAny( Text.Split([description], " "), words )
            then [cost]
            else [cost]*1.03,
    type number )
in
    adjustCost