Forum Discussion

ryan_b_123's avatar
ryan_b_123
Frequent Visitor
2 years ago
Solved

Using value from column to affect calculation in Power Query

Col 1 Col 2 Col 3 Desired Result 4 + 5 9 3 - 2 1   Let's say I have above dataset: To do above, I could write a formula in Power QUery something like "if [col 2] = "+" then [C...
  • HotChilli's avatar
    2 years ago

    Yes, there is a way.

    Use Expression.Evaluate

    You can build a string from the first 3 columns ( either by appending with & or use Text.Combine and then just pass that to Expression.Evaluate()