Power Query Function error when joining
<p>I am receiving this error 
There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression</p>

<p>I created the function below that maps a new column based on the values of 4 input columns.  The function works on the table that i applied it to.  However when i join the table to another table i receive the above error.  </p>

<p>All of the inputs to the function are text columns.  if someone has some experience with this it would be a great help.</p>

<pre><code>// FNStage1Transform

let Stage1 = (term,investment_universe,Risk_tolerance,Special) =&gt;

let 
    Stage1Transform =

if List.Contains({"Short","Intermediate"},term) and List.Contains({"Short","Aggregate","Gov/Credit"},investment_universe ) then term
else if term ="Full" then 
 if investment_universe = "Treasury" then term&amp;" "&amp;  investment_universe 
 else if investment_universe ="TIPS" then "Full+Long"&amp;" "&amp;investment_universe 
 else if investment_universe ="Muni" and [Risk Tolerance] = "Conservative" then investment_universe 
 else if List.Contains({"Credit","Corp"},investment_universe) then "CredCorp"
 else investment_universe
else if term  = "Long" and  investment_universe ="TIPS" then "Full+Long"&amp;" "&amp;investment_universe 
else if term  = "Long" and List.Contains({"Credit","Corp"},investment_universe) then term &amp;" "&amp;investment_universe
else if investment_universe  = "Muni" and Risk_tolerance  = "Conservative" then investment_universe 
else if List.Contains({"Credit","Corp"},investment_universe) then term&amp;" CredCorp"
else term &amp;" "&amp;  investment_universe,


Stage2Transform = if List.Contains({"High Beta","Transition"},Risk_tolerance) then Risk_tolerance 
else if Special = "Yes" then Stage1Transform &amp;" "&amp; Risk_tolerance &amp; " Special"

else if Risk_tolerance = "Standard" then Stage1Transform
else Stage1Transform &amp;" "&amp;Risk_tolerance,


Stage3transform = "PS_"&amp; Stage2Transform,



Result = Stage3transform 





in Result

in
    Stage1
</code></pre>