<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Power Query custom function to replace multiple values in a column in Power Query</title>
    <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172004#M38136</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm tryiing to create a custom function to find and replace values, all in one step.&amp;nbsp;I really would love to solve this problem without an extra table or DAX SWITCH.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample file &lt;A href="https://1drv.ms/u/s!AhXv3usXHZ51jekbdL7T_XXqy-WOzA?e=LhpBrE" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only the last step seems to be executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(myFruit as text) =&amp;gt;&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;&lt;BR /&gt;#"Replace a" = Replacer.ReplaceValue(myFruit, "a","apple"),&lt;BR /&gt;#"Replace b" = Replacer.ReplaceValue(myFruit, "b","banana"),&lt;BR /&gt;#"Replace l" = Replacer.ReplaceValue(myFruit, "l","lemon")&lt;BR /&gt;&lt;BR /&gt;in&lt;BR /&gt;&lt;BR /&gt;#"Replace l"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brigi&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jun 2020 14:34:34 GMT</pubDate>
    <dc:creator>brigittagemes</dc:creator>
    <dc:date>2020-06-20T14:34:34Z</dc:date>
    <item>
      <title>Power Query custom function to replace multiple values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172004#M38136</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm tryiing to create a custom function to find and replace values, all in one step.&amp;nbsp;I really would love to solve this problem without an extra table or DAX SWITCH.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample file &lt;A href="https://1drv.ms/u/s!AhXv3usXHZ51jekbdL7T_XXqy-WOzA?e=LhpBrE" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only the last step seems to be executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(myFruit as text) =&amp;gt;&lt;BR /&gt;&lt;BR /&gt;let&lt;BR /&gt;&lt;BR /&gt;#"Replace a" = Replacer.ReplaceValue(myFruit, "a","apple"),&lt;BR /&gt;#"Replace b" = Replacer.ReplaceValue(myFruit, "b","banana"),&lt;BR /&gt;#"Replace l" = Replacer.ReplaceValue(myFruit, "l","lemon")&lt;BR /&gt;&lt;BR /&gt;in&lt;BR /&gt;&lt;BR /&gt;#"Replace l"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brigi&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 14:34:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172004#M38136</guid>
      <dc:creator>brigittagemes</dc:creator>
      <dc:date>2020-06-20T14:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query custom function to replace multiple values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172111#M38140</link>
      <description>&lt;P&gt;You need to refer to the previous step in each step.&amp;nbsp; Your last step starts with myFruit, so only it is executed.&amp;nbsp; See modified function below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(myFruit as text) =&amp;gt;

let

#"Replace a" = Replacer.ReplaceValue(myFruit, "a","apple"),
#"Replace b" = Replacer.ReplaceValue(#"Replace a", "b","banana"),
#"Replace l" = Replacer.ReplaceValue(#"Replace b", "l","lemon")

in

#"Replace l"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 20:37:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172111#M38140</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-06-20T20:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query custom function to replace multiple values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172319#M38153</link>
      <description>&lt;P&gt;Thank you, works perfectly! This is exactly what I was looking for!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried referencing before, but I failed. I couldn't find any hints that the first parameter for the Replacer.ReplaceValue can be the previous step itself, instead of "myFruit", the future column reference. I struggled with adding both, which made one extra parameter for the Replacer.ReplaceValue.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 10:32:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1172319#M38153</guid>
      <dc:creator>brigittagemes</dc:creator>
      <dc:date>2020-06-21T10:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Power Query custom function to replace multiple values in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1414089#M44218</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;I'm looking to do something similar but cant figure out this code.&lt;/P&gt;&lt;P&gt;Where do I enter the code? as a new column..?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is part of a 80x4000 table not just a single row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked at other solutions that converted data to a list and then recombines but this removes the rest of the data outside the one column being edited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is environmental data.&lt;/P&gt;&lt;P&gt;1. Several numerical columns contain values less than the detection limit and are entered into the raw file as "&amp;lt;0.1", "&amp;lt;0.05", "X" etc. These need to be changed to a value half the detection limit eg. 0.05, 0.025.&lt;/P&gt;&lt;P&gt;2. One column containing classification identifiers needs to be edited for consistency/grouping. eg. "HC1, "HC2", "HC3" all changed to "HC".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for help!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 00:51:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Power-Query/Power-Query-custom-function-to-replace-multiple-values-in-a/m-p/1414089#M44218</guid>
      <dc:creator>mef47</dc:creator>
      <dc:date>2020-10-06T00:51:44Z</dc:date>
    </item>
  </channel>
</rss>

