Forum Discussion

mechanix85's avatar
mechanix85
Helper I
9 years ago
Solved

Table.TransformColumns by criteria

Hello! How can I convert a column by a condition?   Something like this if type = №2 and type2 = true then List.Product({_, -1}) else List.Product({_, 1}) ???      
  • v-jiascu-msft's avatar
    v-jiascu-msft
    9 years ago

    Hi mechanix85,

     

    You could try this. It worked in my test.

     

    #"Replaced Value" = 
              Table.ReplaceValue(#"Changed Type1",
              each [value],
              each if [type] = "No2" and [type2] = true then [value] * -1 else [value] * 1,
              Replacer.ReplaceValue,{"value"}),

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale