Forum Discussion

powerbiuser101's avatar
powerbiuser101
Advocate I
8 years ago
Solved

How to replace text based on filter?

I'm trying to write a query to replace text but only based on values of another column. Example:   Main Side Drink Price Burger   Soda 5.00   Fries Soda 2.00 Burger Fries Sod...
  • v-jiascu-msft's avatar
    8 years ago

    Hi powerbiuser101,

     

    1. In the Query Editor, right click the blanks in the column Drink, then select Replace Values. Enter 1 to the Replace with.

    How_to_replace_text_based_on_filter1

    2. Open the Advanced Editor. Replace the 1 with the code below.

    each if [Main] = "Salad" and [Side] = "Apple" then "Orange Juice" else " "

    How_to_replace_text_based_on_filter2

     

    Best Regards,

    Dale